Driver for the AES (Advanced Encryption Standard) module.
Provides functions for configuring and initiating ciphering/deciphering with AES algorithms. Several modes (ECB, CBC, OFB, CFB or CTR) and key sizes (128-, 192- or 256-bit) are supported, in addition to manual or DMA-based data input to the AES module.
Modules | |
Related Project(s) | |
In this section you can find all the projects related to the AES - Advanced Encryption Standard. | |
Data Structures | |
struct | aes_config_t |
AES Configuration structure. More... | |
struct | aes_isrconfig_t |
AES Interrupt configuration structure. More... | |
Macros | |
#define | AES_CBC_MODE 1 |
#define | AES_CFB_MODE 3 |
#define | AES_CTR_MODE 4 |
#define | AES_ECB_MODE 0 |
AES Operation cipher mode. More... | |
#define | AES_KEY_SIZE_128 0 |
AES Cryptographic key size. More... | |
#define | AES_KEY_SIZE_192 1 |
#define | AES_KEY_SIZE_256 2 |
#define | AES_OFB_MODE 2 |
#define | AES_PMODE_CIPHER 1 |
#define | AES_PMODE_DECIPHER 0 |
AES Processing mode. More... | |
#define | AES_START_MODE_AUTO 1 |
#define | AES_START_MODE_DMA 2 |
#define | AES_START_MODE_MANUAL 0 |
AES Start mode. More... | |
#define | AES_URAT_INPUTWRITE_DMA 0 |
AES URAD Type. More... | |
#define | AES_URAT_MRWRITE_PROCESS 2 |
#define | AES_URAT_MRWRITE_SUBKEY 4 |
#define | AES_URAT_OUTPUTREAD_PROCESS 1 |
#define | AES_URAT_OUTPUTREAD_SUBKEY 3 |
#define | AES_URAT_READ_WRITEONLY 5 |
Functions | |
void | aes_configure (volatile avr32_aes_t *aes, const aes_config_t *pAesConfig) |
Configure the AES. More... | |
unsigned int | aes_get_status (volatile avr32_aes_t *aes) |
Get the AES status. More... | |
void | aes_isr_configure (volatile avr32_aes_t *aes, const aes_isrconfig_t *pAesIsrConfig) |
Configure the AES interrupts. More... | |
static __always_inline void | aes_load_newseed (volatile avr32_aes_t *aes) |
Trigger the load of a new seed in the AES internal random number generator (used for security counter measures). More... | |
void | aes_read_outputdata (volatile avr32_aes_t *aes, unsigned int *pOut) |
Read the 128/64/32/16/8bit input data. More... | |
void | aes_set_initvector (volatile avr32_aes_t *aes, const unsigned int *pVector) |
Set the 128bit initialization vector (for the CBC, CFB, OFB & CTR cipher modes) More... | |
void | aes_set_key (volatile avr32_aes_t *aes, const unsigned int *pKey) |
Set the 128/192/256bit cryptographic key. More... | |
static __always_inline void | aes_start (volatile avr32_aes_t *aes) |
Start the cipher/decipher process [manual mode only]. More... | |
static __always_inline void | aes_swreset (volatile avr32_aes_t *aes) |
Perform a software reset of the AES. More... | |
void | aes_write_inputdata (volatile avr32_aes_t *aes, const unsigned int *pIn) |
Write the 128/64/32/16/8bit input data. More... | |
#define AES_CBC_MODE 1 |
Referenced by main().
#define AES_CFB_MODE 3 |
Referenced by aes_read_outputdata(), and aes_write_inputdata().
#define AES_CTR_MODE 4 |
#define AES_ECB_MODE 0 |
AES Operation cipher mode.
Referenced by main().
#define AES_KEY_SIZE_128 0 |
AES Cryptographic key size.
Referenced by main().
#define AES_KEY_SIZE_192 1 |
#define AES_KEY_SIZE_256 2 |
Referenced by main().
#define AES_OFB_MODE 2 |
#define AES_PMODE_CIPHER 1 |
Referenced by main().
#define AES_PMODE_DECIPHER 0 |
AES Processing mode.
Referenced by main().
#define AES_START_MODE_AUTO 1 |
Referenced by main().
#define AES_START_MODE_DMA 2 |
Referenced by main().
#define AES_START_MODE_MANUAL 0 |
AES Start mode.
Referenced by main().
#define AES_URAT_INPUTWRITE_DMA 0 |
AES URAD Type.
#define AES_URAT_MRWRITE_PROCESS 2 |
#define AES_URAT_MRWRITE_SUBKEY 4 |
#define AES_URAT_OUTPUTREAD_PROCESS 1 |
#define AES_URAT_OUTPUTREAD_SUBKEY 3 |
#define AES_URAT_READ_WRITEONLY 5 |
Referenced by aes_int_handler().
void aes_configure | ( | volatile avr32_aes_t * | aes, |
const aes_config_t * | pAesConfig | ||
) |
Configure the AES.
*aes | Base address of the AES |
*pAesConfig | Parameters for the AES configuration |
References AES_CKEY, aes_config_t::CFBSize, aes_config_t::CounterMeasureMask, aes_config_t::KeySize, aes_config_t::LodMode, aes_config_t::OpMode, aes_config_t::ProcessingDelay, aes_config_t::ProcessingMode, and aes_config_t::StartMode.
Referenced by main().
unsigned int aes_get_status | ( | volatile avr32_aes_t * | aes | ) |
Get the AES status.
*aes | Base address of the AES |
Referenced by aes_int_handler().
void aes_isr_configure | ( | volatile avr32_aes_t * | aes, |
const aes_isrconfig_t * | pAesIsrConfig | ||
) |
Configure the AES interrupts.
*aes | Base address of the AES |
*pAesIsrConfig | Parameters for the AES interrupts configuration |
References aes_isrconfig_t::datrdy, Disable_global_interrupt, Enable_global_interrupt, Is_global_interrupt_enabled, and aes_isrconfig_t::urad.
Referenced by main().
|
static |
Trigger the load of a new seed in the AES internal random number generator (used for security counter measures).
*aes | Base address of the AES |
void aes_read_outputdata | ( | volatile avr32_aes_t * | aes, |
unsigned int * | pOut | ||
) |
Read the 128/64/32/16/8bit input data.
*aes | Base address of the AES |
*pOut | Pointer on 4/2/1 pre-allocated contiguous 32bit words. |
References AES_CFB_MODE.
Referenced by aes_int_handler().
void aes_set_initvector | ( | volatile avr32_aes_t * | aes, |
const unsigned int * | pVector | ||
) |
Set the 128bit initialization vector (for the CBC, CFB, OFB & CTR cipher modes)
*aes | Base address of the AES |
*pVector | Pointer on 4 contiguous 32bit words. |
References i.
Referenced by main(), and test_ram_aes_ram().
void aes_set_key | ( | volatile avr32_aes_t * | aes, |
const unsigned int * | pKey | ||
) |
Set the 128/192/256bit cryptographic key.
*aes | Base address of the AES |
*pKey | Pointer on 4/6/8 contiguous 32bit words. |
Referenced by main(), and test_ram_aes_ram().
|
static |
Start the cipher/decipher process [manual mode only].
*aes | Base address of the AES |
Referenced by main().
|
static |
Perform a software reset of the AES.
*aes | Base address of the AES |
Referenced by aes_int_handler().
void aes_write_inputdata | ( | volatile avr32_aes_t * | aes, |
const unsigned int * | pIn | ||
) |
Write the 128/64/32/16/8bit input data.
*aes | Base address of the AES |
*pIn | Pointer on 4/2/1 contiguous 32bit words. |
References AES_CFB_MODE.
Referenced by main().