InPlay API

AES cryptography configuration structure. More...

#include <hal_aes.h>

Data Fields

aes_crypto_mode mode
 
aes_key_size key_size
 
const uint8_t * key
 
const uint8_t * mac
 
uint8_t mac_length
 
uint16_t total_msg_length
 
uint8_t * salt
 
uint8_t * key2
 
uint8_t * ctr_blk
 
uint8_t * key3
 
uint8_t * iv
 

Detailed Description

AES cryptography configuration structure.

Note
Different modes need different parameters, pointers not used in the structure should be set to NULL. If MAC is to be verified, MAC should not be NULL, else MAC should be NULL. Parameters needes for different modes: ECB: mode, key_size, key CBC: mode, key_size, key, iv CTR: mode, key_size, key, ctr_blk CCM: mode, key_size, key, ctr_blk, mac, total_msg_length CMAC: mode, key_size, key, mac XCBC: mode, key_size, key, key2, key2, mac F8: mode, key_size, key, salt, iv

Field Documentation

◆ ctr_blk

uint8_t* ctr_blk

Pointer to the initial counter block in CTR mode, or Ctr0 in CCM mode, should be 16 bytes

◆ iv

uint8_t* iv

Pointer to the initialization vector used in CBC/F8 mode, should be 16 bytes

◆ key

const uint8_t* key

Pointer to the key, 16 bytes, 24 bytes or 32 bytes. Or key1 for XCBC mode

◆ key2

uint8_t* key2

Pointer to key2 for XCBC mode

◆ key3

uint8_t* key3

Pointer to key3 for XCBC mode

◆ key_size

aes_key_size key_size

Key size, enum aes_key_size

◆ mac

const uint8_t* mac

Pointer to Message Authentication Code, Required in CMAC/CCM/XCBC mode decryption

◆ mac_length

uint8_t mac_length

Length of Message Authentication Code in bytes, should be <=16

◆ mode

Operation mode, enum aes_crypto_mode

◆ salt

uint8_t* salt

Pointer to salt, only used in F8 mode. The salt is the same size as the key - up to a maximum of 32 bytes

◆ total_msg_length

uint16_t total_msg_length

Total length of message data (across all segments not including AD) to process. Only required in CCM mode.