Class that implements 2 hiding techniques: dummy-ops & shuffling.
More...
#include <hiding.h>
|
void | shuffleArray (uint8_t array[], const uint8_t size) |
| Shuffle an array using the Fisher-Yates shuffle. More...
|
|
|
static constexpr uint8_t | MAX_NUMBER_NO_OPS = 100 |
| The maximum number of NOPs per AES execution. It is important that this number stays the same for every AES execution.
|
|
static constexpr uint8_t | NUMBER_OPS = 40 |
| The number of operations before which the dummy ops are executed.
|
|
static uint8_t | DEFAULT_INV_SBOX_INDICES [STATE_BYTES] |
| Array that contains values from 0 to 15.
|
|
Class that implements 2 hiding techniques: dummy-ops & shuffling.
As a counter-measure against DPA attacks, hiding can be used to randomize the timing behaviour of the AES en-/decryption. This can be done by adding random dummy-ops or by randomly shuffling the S-Box access.
- Authors
- Philipp Karg (phili.nosp@m.pp.k.nosp@m.arg@t.nosp@m.um.d.nosp@m.e)
- Date
- 04.07.2022
- Copyright
- Philipp Karg 2022
◆ init()
Initialize AES hiding operations.
- Seed the RNG.
- Init the dummy ops by creating an array of random numbers, w which will be the number of dummy ops per round. It is important that the total number of dummy ops stays the same for every AES execution.
◆ shuffleArray()
void Hiding::shuffleArray |
( |
uint8_t |
array[], |
|
|
const uint8_t |
size |
|
) |
| |
|
private |
Shuffle an array using the Fisher-Yates shuffle.
- Parameters
-
[in,out] | array | (uint8_t []): Array to shuffle. |
[in] | size | (const uint8_t): Size of the array. |
◆ shuffleSBoxAccess()
void Hiding::shuffleSBoxAccess |
( |
uint8_t |
indices[] | ) |
|
Shuffle the S-Box access.
Randomize the S-Box access by shuffling the indices of the S-Box.
- Parameters
-
[out] | indices | (uint8_t []): Array of indices of the S-Box. |
The documentation for this class was generated from the following file: