Class providing functionality for 128-bit AES decryption.
More...
#include <aes.h>
|
| AES (const aes_key_t masterKey) |
| Construct a new AES object. More...
|
|
void | decrypt (uint8_t *cipher) |
| Decrypt a cipher using the 128-bit AES algorithm. More...
|
|
|
static uint8_t | mRCs [ROUNDS] |
| Array of round coefficients that are used in the key schedule.
|
|
Class providing functionality for 128-bit AES decryption.
If MASKING is defined, the class also provides functionality for masking and unmasking AES-decryption.
- Authors
- Philipp Karg (phili.nosp@m.pp.k.nosp@m.arg@t.nosp@m.um.d.nosp@m.e)
- Date
- 23.05.2022
- Copyright
- Philipp Karg 2022
◆ AES()
AES::AES |
( |
const aes_key_t |
masterKey | ) |
|
Construct a new AES object.
- Parameters
-
[in] | masterKey | (const aes_key_t): The master key. |
◆ addRoundKey()
void AES::addRoundKey |
( |
const aes_key_t |
roundKey, |
|
|
state_t |
state |
|
) |
| |
|
private |
Add the key for the current round to state
.
X-OR each byte of state
with the corresponding byte in roundKey
.
- Parameters
-
[in] | roundKey | (const aes_key_t): Key for the current round. |
[in,out] | state | ( state_t): Current state matrix. |
◆ createKeySchedule()
void AES::createKeySchedule |
( |
const aes_key_t |
masterKey, |
|
|
sub_keys_t |
subKeys |
|
) |
| const |
|
private |
Create the AES key-schedule & store all subkeys in mSubkeys.
- The first subkey is
masterKey
.
- The remaining subkeys are calculated as defined in the AES standard. See p. 106-108 for reference.
- Parameters
-
[in] | masterKey | (const aes_key_t): The master key, which is used to create the key schedule. |
[out] | subKeys | ( sub_keys_t): Array that contains all subkeys. |
◆ decrypt()
void AES::decrypt |
( |
uint8_t * |
cipher | ) |
|
Decrypt a cipher using the 128-bit AES algorithm.
- See also
- p. 110-112
- Parameters
-
[in,out] | cipher | (uint8_t *): Cipher to decrypt. |
◆ invByteSub()
void AES::invByteSub |
( |
state_t |
state | ) |
|
|
private |
Inverse Byte Substituion layer.
Substitute each byte in state
with the corresponding value in #INV_S_BOX.
- Parameters
-
[in,out] | state | ( state_t): Current state matrix. |
◆ invMixCols()
void AES::invMixCols |
( |
state_t |
state | ) |
|
|
private |
Inverse MixColumn sublayer.
Do a matrix-matrix multiplication of state
& #INV_MIX_COL_MATRIX.
- Parameters
-
[in,out] | state | ( state_t): Current state matrix. |
◆ invShiftRows()
void AES::invShiftRows |
( |
state_t |
state | ) |
|
|
private |
Inverse ShiftRows sublayer.
Rotate each row of the state
matrix by the row-number to the right.
- Parameters
-
[in,out] | state | ( state_t): Current state matrix. |
The documentation for this class was generated from the following file: