MAX78000 Peripheral Driver API
Peripheral Driver API for the MAX78000
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
AES

Modules

 AES_Registers
 
 AESKEYS_Registers
 

Data Structures

struct  mxc_aes_req_t
 

Enumerations

enum  mxc_aes_keys_t
 
enum  mxc_aes_enc_type_t
 

Functions

int MXC_AES_Init (void)
 
void MXC_AES_EnableInt (uint32_t interrupt)
 
void MXC_AES_DisableInt (uint32_t interrupt)
 
int MXC_AES_IsBusy (void)
 
int MXC_AES_Shutdown (void)
 
void MXC_AES_DMACallback (int ch, int error)
 
void MXC_AES_GenerateKey (void)
 
void MXC_AES_SetKeySize (mxc_aes_keys_t key)
 
mxc_aes_keys_t MXC_AES_GetKeySize (void)
 
void MXC_AES_FlushInputFIFO (void)
 
void MXC_AES_FlushOutputFIFO (void)
 
void MXC_AES_Start (void)
 
uint32_t MXC_AES_GetFlags (void)
 
void MXC_AES_ClearFlags (uint32_t flags)
 
int MXC_AES_Generic (mxc_aes_req_t *req)
 
int MXC_AES_Encrypt (mxc_aes_req_t *req)
 
int MXC_AES_Decrypt (mxc_aes_req_t *req)
 
int MXC_AES_TXDMAConfig (void *src_addr, int len)
 
int MXC_AES_RXDMAConfig (void *dest_addr, int len)
 
int MXC_AES_GenericAsync (mxc_aes_req_t *req, uint8_t enc)
 
int MXC_AES_EncryptAsync (mxc_aes_req_t *req)
 
int MXC_AES_DecryptAsync (mxc_aes_req_t *req)
 
void MXC_AES_SetExtKey (const void *key, mxc_aes_keys_t len)
 

Detailed Description


Data Structure Documentation

◆ mxc_aes_req_t

struct mxc_aes_req_t

Structure used to set up AES request.

Data Fields

uint32_t length
 
uint32_t * inputData
 
uint32_t * resultData
 
mxc_aes_keys_t keySize
 
mxc_aes_enc_type_t encryption
 
mxc_aes_complete_t callback
 

Enumeration Type Documentation

◆ mxc_aes_enc_type_t

Enumeration type to select AES key source and encryption type.

Enumerator
MXC_AES_ENCRYPT_EXT_KEY 

Encryption using External key.

MXC_AES_DECRYPT_EXT_KEY 

Encryption using internal key.

MXC_AES_DECRYPT_INT_KEY 

Decryption using internal key.

◆ mxc_aes_keys_t

Enumeration type to select AES key.

Enumerator
MXC_AES_128BITS 

Select AES-128 bit key.

MXC_AES_192BITS 

Select AES-192 bit key.

MXC_AES_256BITS 

Select AES-256 bit key.

Function Documentation

◆ MXC_AES_ClearFlags()

void MXC_AES_ClearFlags ( uint32_t  flags)

Clear the interrupts.

Parameters
flagsflags to be cleared

◆ MXC_AES_Decrypt()

int MXC_AES_Decrypt ( mxc_aes_req_t req)

Perform a decryption.

Note
The result will be stored in the req structure
Parameters
reqStructure containing data for the decryption
Returns
Success/Fail, see Error Codes for a list of return codes.

◆ MXC_AES_DecryptAsync()

int MXC_AES_DecryptAsync ( mxc_aes_req_t req)

Perform a decryption using Interrupt.

Note
The result will be stored in the req structure. The user needs to call MXC_AES_Handler() in the ISR
Parameters
reqStructure containing data for the decryption
Returns
Success/Fail, see Error Codes for a list of return codes.

◆ MXC_AES_DisableInt()

void MXC_AES_DisableInt ( uint32_t  interrupt)

Disable AES Interrupts.

Parameters
interruptinterrupt to disable

◆ MXC_AES_EnableInt()

void MXC_AES_EnableInt ( uint32_t  interrupt)

Enable AES Interrupts.

Parameters
interruptinterrupt to enable

◆ MXC_AES_Encrypt()

int MXC_AES_Encrypt ( mxc_aes_req_t req)

Perform an encryption.

Note
The result will be stored in the req structure
Parameters
reqStructure containing data for the encryption
Returns
Success/Fail, see Error Codes for a list of return codes.

◆ MXC_AES_EncryptAsync()

int MXC_AES_EncryptAsync ( mxc_aes_req_t req)

Perform an encryption using Interrupt.

Note
The result will be stored in the req structure. The user needs to call MXC_AES_Handler() in the ISR
Parameters
reqStructure containing data for the encryption
Returns
Success/Fail, see Error Codes for a list of return codes.

◆ MXC_AES_Generic()

int MXC_AES_Generic ( mxc_aes_req_t req)
Note
The result will be stored in the req structure
Parameters
reqStructure containing data for the encryption
Returns
Success/Fail, see Error Codes for a list of return codes.

◆ MXC_AES_GenericAsync()

int MXC_AES_GenericAsync ( mxc_aes_req_t req,
uint8_t  enc 
)

Perform encryption or decryption using DMA.

Parameters
reqThe result will be stored in the req structure. The user needs to call MXC_AES_Handler() in the ISR
enc0 for encryption and 1 for decryption
Returns
Success/Fail, see Error Codes for a list of return codes.

◆ MXC_AES_GetFlags()

uint32_t MXC_AES_GetFlags ( void  )

Get Interrupt flags set.

Returns
return the flags set in intfl register

◆ MXC_AES_GetKeySize()

mxc_aes_keys_t MXC_AES_GetKeySize ( void  )

Get the currently set key size.

Returns
mxc_aes_keys_t see mxc_aes_keys_t

◆ MXC_AES_Init()

int MXC_AES_Init ( void  )

Enable portions of the AES.

Returns
Success/Fail, see Error Codes for a list of return codes.

◆ MXC_AES_IsBusy()

int MXC_AES_IsBusy ( void  )

Checks the global AES Busy Status.

Returns
E_BUSY if busy and E_NO_ERROR otherwise, see Error Codes for a list of return codes.

◆ MXC_AES_RXDMAConfig()

int MXC_AES_RXDMAConfig ( void *  dest_addr,
int  len 
)

Perform AES RX using DMA. Configures DMA request and receives data from AES FIFO.

Parameters
dest_addrdestination address
lennumber of words of data
Returns
Success/Fail, see Error Codes for a list of return codes.

◆ MXC_AES_SetExtKey()

void MXC_AES_SetExtKey ( const void *  key,
mxc_aes_keys_t  len 
)

Set the external key.

Parameters
keyBuffer for the key.
lenKey size.

◆ MXC_AES_SetKeySize()

void MXC_AES_SetKeySize ( mxc_aes_keys_t  key)

Set Key size for encryption or decryption.

Parameters
keyKey size, see mxc_aes_keys_t for a list of keys

◆ MXC_AES_Shutdown()

int MXC_AES_Shutdown ( void  )

Disable and reset portions of the AES.

Returns
Success/Fail, see Error Codes for a list of return codes.

◆ MXC_AES_TXDMAConfig()

int MXC_AES_TXDMAConfig ( void *  src_addr,
int  len 
)

Perform AES TX using DMA. Configures DMA request and starts the transmission.

Parameters
src_addrsource address
lennumber of words of data
Returns
Success/Fail, see Error Codes for a list of return codes.