MODA  1.0.1
ModularAES
AES Block Cipher

Description

Interface to the block cipher defined in FIPS-197.

Functions

void MODA_AES_Init (struct aes_ctxt *aes, enum aes_key_size keySize, const uint8_t *key)
 Initialise an AES block cipher by expanding a key. More...
 
void MODA_AES_Encrypt (const struct aes_ctxt *aes, uint8_t *s)
 Encrypt a block of memory called state. More...
 
void MODA_AES_Decrypt (const struct aes_ctxt *aes, uint8_t *s)
 Decrypt a block of memory called state. More...
 

Data Structures

struct  aes_ctxt
 Stores the expanded key. More...
 

Macros

#define AES_BLOCK_SIZE   16U
 block cipher block size in bytes
 

Enumerations

enum  aes_key_size { AES_KEY_128 = 16U, AES_KEY_192 = 24U, AES_KEY_256 = 32U }
 Supported key sizes. More...
 

Data Structure Documentation

struct aes_ctxt

Stores the expanded key.

Examples:
test_aes.c, test_aes_cmac.c, test_aes_gcm.c, and test_aes_wrap.c.
Data Fields
uint8_t k[240U] expanded key
uint8_t r number of rounds

Enumeration Type Documentation

Supported key sizes.

Enumerator
AES_KEY_128 

AES-128.

AES_KEY_192 

AES-198.

AES_KEY_256 

AES-256.

Function Documentation

void MODA_AES_Decrypt ( const struct aes_ctxt aes,
uint8_t *  s 
)

Decrypt a block of memory called state.

Parameters
[in]aesexpanded key
[in]spointer to AES_BLOCK_SIZE bytes of state (any alignment)
Examples:
test_aes.c.
void MODA_AES_Encrypt ( const struct aes_ctxt aes,
uint8_t *  s 
)

Encrypt a block of memory called state.

Parameters
[in]aesexpanded key
[in]spointer to AES_BLOCK_SIZE bytes of state (any alignment)
Examples:
test_aes.c.
void MODA_AES_Init ( struct aes_ctxt aes,
enum aes_key_size  keySize,
const uint8_t *  key 
)

Initialise an AES block cipher by expanding a key.

Parameters
[in]aesexpanded key
[in]keySizeenumerated size of key
[in]keypointer to the key (any alignment)
Examples:
test_aes.c, test_aes_cmac.c, test_aes_gcm.c, and test_aes_wrap.c.