Macros | |
#define | Nb 4 |
#define | BLOCKLEN 16 |
#define | Nk 8 |
#define | KEYLEN 32 |
#define | Nr 14 |
#define | keyExpSize 240 |
#define | MULTIPLY_AS_A_FUNCTION 0 |
#define | Multiply(x, y) |
Typedefs | |
typedef uint8_t | state_t[4][4] |
Functions | |
static uint8_t | getSBoxValue (uint8_t num) |
static uint8_t | getSBoxInvert (uint8_t num) |
static void | KeyExpansion (void) |
static void | AddRoundKey (uint8_t round) |
static void | SubBytes (void) |
static void | ShiftRows (void) |
static uint8_t | xtime (uint8_t x) |
static void | MixColumns (void) |
static void | InvMixColumns (void) |
static void | InvSubBytes (void) |
static void | InvShiftRows (void) |
static void | Cipher (void) |
static void | InvCipher (void) |
void | AES_ECB_encrypt (const uint8_t *input, const uint8_t *key, uint8_t *output, const uint32_t length) |
void | AES_ECB_decrypt (const uint8_t *input, const uint8_t *key, uint8_t *output, const uint32_t length) |
static void | XorWithIv (uint8_t *buf) |
void | AES_CBC_encrypt_buffer (uint8_t *output, uint8_t *input, uint32_t length, const uint8_t *key, const uint8_t *iv) |
void | AES_CBC_decrypt_buffer (uint8_t *output, uint8_t *input, uint32_t length, const uint8_t *key, const uint8_t *iv) |
void | AES_CTR_xcrypt_buffer (uint8_t *output, uint8_t *input, uint32_t length, const uint8_t *key, const uint8_t *nonce) |
Variables | |
static state_t * | state |
static uint8_t | RoundKey [keyExpSize] |
static const uint8_t * | Key |
static uint8_t * | Iv |
static const uint8_t | sbox [256] |
static const uint8_t | rsbox [256] |
static const uint8_t | Rcon [11] |
#define Nb 4 |
Referenced by AddRoundKey(), and KeyExpansion().
#define BLOCKLEN 16 |
Referenced by AES_CBC_decrypt_buffer(), AES_CBC_encrypt_buffer(), AES_CTR_xcrypt_buffer(), and XorWithIv().
#define Nk 8 |
Referenced by KeyExpansion().
#define KEYLEN 32 |
#define Nr 14 |
Referenced by Cipher(), InvCipher(), and KeyExpansion().
#define keyExpSize 240 |
#define MULTIPLY_AS_A_FUNCTION 0 |
#define Multiply | ( | x, | |
y | |||
) |
typedef uint8_t state_t[4][4] |
|
static |
References sbox.
Referenced by KeyExpansion(), and SubBytes().
|
static |
|
static |
References getSBoxValue(), Key, Nb, Nk, Nr, Rcon, and RoundKey.
Referenced by AES_CBC_decrypt_buffer(), AES_CBC_encrypt_buffer(), AES_CTR_xcrypt_buffer(), AES_ECB_decrypt(), and AES_ECB_encrypt().
|
static |
|
static |
References getSBoxValue(), and state.
Referenced by Cipher().
|
static |
|
static |
|
static |
|
static |
|
static |
References getSBoxInvert(), and state.
Referenced by InvCipher().
|
static |
|
static |
References AddRoundKey(), MixColumns(), Nr, ShiftRows(), and SubBytes().
Referenced by AES_CBC_encrypt_buffer(), AES_CTR_xcrypt_buffer(), and AES_ECB_encrypt().
|
static |
References AddRoundKey(), InvMixColumns(), InvShiftRows(), InvSubBytes(), and Nr.
Referenced by AES_CBC_decrypt_buffer(), and AES_ECB_decrypt().
void AES_ECB_encrypt | ( | const uint8_t * | input, |
const uint8_t * | key, | ||
uint8_t * | output, | ||
const uint32_t | length | ||
) |
void AES_ECB_decrypt | ( | const uint8_t * | input, |
const uint8_t * | key, | ||
uint8_t * | output, | ||
const uint32_t | length | ||
) |
|
static |
Referenced by AES_CBC_decrypt_buffer(), and AES_CBC_encrypt_buffer().
void AES_CBC_encrypt_buffer | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint32_t | length, | ||
const uint8_t * | key, | ||
const uint8_t * | iv | ||
) |
References BLOCKLEN, Cipher(), Iv, Key, KeyExpansion(), state, and XorWithIv().
Referenced by TinyAES::cbc_encrypt().
void AES_CBC_decrypt_buffer | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint32_t | length, | ||
const uint8_t * | key, | ||
const uint8_t * | iv | ||
) |
References BLOCKLEN, InvCipher(), Iv, Key, KeyExpansion(), state, and XorWithIv().
Referenced by TinyAES::cbc_decrypt().
void AES_CTR_xcrypt_buffer | ( | uint8_t * | output, |
uint8_t * | input, | ||
uint32_t | length, | ||
const uint8_t * | key, | ||
const uint8_t * | nonce | ||
) |
References BLOCKLEN, Cipher(), Key, KeyExpansion(), and state.
|
static |
|
static |
Referenced by AddRoundKey(), and KeyExpansion().
|
static |
|
static |
Referenced by AES_CBC_decrypt_buffer(), AES_CBC_encrypt_buffer(), and XorWithIv().
|
static |
Referenced by getSBoxValue().
|
static |
Referenced by getSBoxInvert().
|
static |
Referenced by KeyExpansion().