MSPM0G1X0X_G3X0X Driver Library  1.10.01.05
Data Structures | Macros | Enumerations | Functions
Advanced Encryption Standard (AES)

Data Structures

struct  DL_AES_backupConfig
 Configuration structure to backup AES peripheral state before going to STOP/STANDBY mode. Used by DL_AES_saveConfiguration. More...
 

Macros

#define DL_AES_INTERRUPT_AES_READY   (AES_CPU_INT_IMASK_AESRDY_MASK)
 AES Ready interrupt.
 
#define DL_AES_EVENT_AES_DMA_TRIGGER0   (AES_DMA_TRIG0_IMASK_DMA0_MASK)
 DMA Trigger Event 0.
 
#define DL_AES_EVENT_AES_DMA_TRIGGER1   (AES_DMA_TRIG1_IMASK_DMA1_SET)
 DMA Trigger Event 1.
 
#define DL_AES_EVENT_AES_DMA_TRIGGER2   (AES_DMA_TRIG2_IMASK_DMA2_SET)
 DMA Trigger Event 2.
 

Enumerations

enum  DL_AES_MODE {
  DL_AES_MODE_ENCRYPT_ECB_MODE,
  DL_AES_MODE_ENCRYPT_CBC_MODE,
  DL_AES_MODE_ENCRYPT_OFB_MODE,
  DL_AES_MODE_ENCRYPT_CFB_MODE,
  DL_AES_MODE_DECRYPT_SAME_KEY_ECB_MODE,
  DL_AES_MODE_DECRYPT_SAME_KEY_CBC_MODE,
  DL_AES_MODE_DECRYPT_SAME_KEY_OFB_MODE,
  DL_AES_MODE_DECRYPT_SAME_KEY_CFB_MODE,
  DL_AES_MODE_GEN_FIRST_ROUND_KEY_ECB_MODE,
  DL_AES_MODE_GEN_FIRST_ROUND_KEY_CBC_MODE,
  DL_AES_MODE_GEN_FIRST_ROUND_KEY_OFB_MODE,
  DL_AES_MODE_GEN_FIRST_ROUND_KEY_CFB_MODE,
  DL_AES_MODE_DECRYPT_KEY_IS_FIRST_ROUND_KEY_ECB_MODE,
  DL_AES_MODE_DECRYPT_KEY_IS_FIRST_ROUND_KEY_CBC_MODE,
  DL_AES_MODE_DECRYPT_KEY_IS_FIRST_ROUND_KEY_OFB_MODE,
  DL_AES_MODE_DECRYPT_KEY_IS_FIRST_ROUND_KEY_CFB_MODE
}
 
enum  DL_AES_IIDX {
  DL_AES_IIDX_AES_READY = AES_CPU_INT_IIDX_STAT_AESRDY,
  DL_AES_IIDX_AES_DMA_TRIGGER0 = AES_DMA_TRIG0_IIDX_STAT_DMA0,
  DL_AES_IIDX_AES_DMA_TRIGGER1 = AES_DMA_TRIG1_IIDX_STAT_DMA1,
  DL_AES_IIDX_AES_DMA_TRIGGER2 = AES_DMA_TRIG2_IIDX_STAT_DMA2
}
 
enum  DL_AES_OPERATION {
  DL_AES_OPERATION_ENC = AES_AESACTL0_OPX_OP0,
  DL_AES_OPERATION_DEC_SAME_KEY = AES_AESACTL0_OPX_OP1,
  DL_AES_OPERATION_GEN_FIRST_ROUND = AES_AESACTL0_OPX_OP2,
  DL_AES_OPERATION_DEC_KEY_IS_FIRST_ROUND = AES_AESACTL0_OPX_OP3
}
 
enum  DL_AES_KEY_LENGTH {
  DL_AES_KEY_LENGTH_128 = AES_AESACTL0_KLX_AES128,
  DL_AES_KEY_LENGTH_256 = AES_AESACTL0_KLX_AES256
}
 
enum  DL_AES_STATUS {
  DL_AES_STATUS_SUCCESS,
  DL_AES_STATUS_UNALIGNED_ACCESS
}
 

Functions

__STATIC_INLINE void DL_AES_enablePower (AES_Regs *aes)
 Enables power on AES module. More...
 
__STATIC_INLINE void DL_AES_disablePower (AES_Regs *aes)
 Disables power on AES module. More...
 
__STATIC_INLINE bool DL_AES_isPowerEnabled (AES_Regs *aes)
 Returns if power enabled on AES module. More...
 
__STATIC_INLINE void DL_AES_reset (AES_Regs *aes)
 Resets AES peripheral. More...
 
__STATIC_INLINE bool DL_AES_isReset (AES_Regs *aes)
 Returns if AES peripheral was reset. More...
 
__STATIC_INLINE void DL_AES_init (AES_Regs *aes, DL_AES_MODE aesConfig, DL_AES_KEY_LENGTH keyLength)
 Initializes AES peripheral. More...
 
__STATIC_INLINE void DL_AES_softwareReset (AES_Regs *aes)
 Immediately resets the complete AES accelerator module even when busy. More...
 
__STATIC_INLINE bool DL_AES_isFaultFlagSet (AES_Regs *aes)
 Returns status of AES error flag. More...
 
__STATIC_INLINE void DL_AES_clearFaultFlag (AES_Regs *aes)
 Clears AES error flag. More...
 
__STATIC_INLINE void DL_AES_enableCipherMode (AES_Regs *aes)
 Enables cipher mode. More...
 
__STATIC_INLINE void DL_AES_disablesCipherMode (AES_Regs *aes)
 Disables cipher mode. More...
 
__STATIC_INLINE void DL_AES_setCipherBlockCounter (AES_Regs *aes, uint32_t count)
 Set cipher block counter value. More...
 
__STATIC_INLINE uint32_t DL_AES_getCipherBlockCounter (AES_Regs *aes)
 Get current cipher block counter value. More...
 
__STATIC_INLINE bool DL_AES_isBusy (AES_Regs *aes)
 Gets the AES module busy status. More...
 
__STATIC_INLINE bool DL_AES_getDataOutReadStatus (AES_Regs *aes)
 Gets the DATAOUT read status. More...
 
__STATIC_INLINE uint8_t DL_AES_getKeyBytesCount (AES_Regs *aes)
 Gets Key byte count. More...
 
__STATIC_INLINE uint8_t DL_AES_getDataInBytesCount (AES_Regs *aes)
 Gets Data In byte count. More...
 
__STATIC_INLINE uint8_t DL_AES_getDataOutBytesCount (AES_Regs *aes)
 Gets Data Out byte count. More...
 
__STATIC_INLINE void DL_AES_setAllDataWritten (AES_Regs *aes)
 Set bit to write all STATE bytes to STATE registers and triggers a new encryption. More...
 
__STATIC_INLINE void DL_AES_setAllKeyWritten (AES_Regs *aes)
 Set bit to write all KEY bytes to KEY register, which is used to encrypt and decrypt data. More...
 
__STATIC_INLINE bool DL_AES_isAllDataWritten (AES_Regs *aes)
 Check if all bytes are to be written to registers containing STATE info. More...
 
__STATIC_INLINE bool DL_AES_isAllKeysWritten (AES_Regs *aes)
 Check if all bytes are to be written to registers containing KEY info. More...
 
DL_AES_STATUS DL_AES_setKey (AES_Regs *aes, const uint8_t *key, DL_AES_KEY_LENGTH keyLength)
 Loads a 128 or 256 bit key to AES module. More...
 
void DL_AES_setKeyAligned (AES_Regs *aes, const uint32_t *keyAligned, DL_AES_KEY_LENGTH keyLength)
 Loads a 128 or 256 bit key to AES module. More...
 
DL_AES_STATUS DL_AES_xorData (uint8_t *data, uint8_t *xorData, uint8_t *xorOutputData)
 XORs an AES 128-bit block of data in software. More...
 
void DL_AES_xorDataAligned (uint32_t *dataAligned, uint32_t *xorDataAligned, uint32_t *xorOutputDataAligned)
 XORs an aligned 128-bit data block in software. More...
 
DL_AES_STATUS DL_AES_loadDataIn (AES_Regs *aes, const uint8_t *data)
 Encrypts a block of data using the AES module. More...
 
void DL_AES_loadDataInAligned (AES_Regs *aes, const uint32_t *dataAligned)
 Encrypts a block of data using the AES module. More...
 
DL_AES_STATUS DL_AES_getDataOut (AES_Regs *aes, uint8_t *data)
 Gets output of encrypted data. More...
 
void DL_AES_getDataOutAligned (AES_Regs *aes, uint32_t *dataAligned)
 Gets output of encrypted data. More...
 
DL_AES_STATUS DL_AES_loadXORDataIn (AES_Regs *aes, const uint8_t *data)
 Data is XORed with the current word of the state and then block of data is encrypted. Encryption or decryption is started immediately after loading data. More...
 
void DL_AES_loadXORDataInAligned (AES_Regs *aes, const uint32_t *dataAligned)
 Data is XORed with the current word of the state and then block of data is encrypted. Encryption or decryption is started immediately after loading data. More...
 
DL_AES_STATUS DL_AES_loadXORDataInWithoutTrigger (AES_Regs *aes, const uint8_t *data)
 Data is XORed with the current word of the state and then block of data is encrypted. Encryption or decryption is NOT started after loading data. More...
 
void DL_AES_loadXORDataInWithoutTriggerAligned (AES_Regs *aes, const uint32_t *dataAligned)
 Data is XORed with the current word of the state and then block of data is encrypted. Encryption or decryption is NOT started after loading data. More...
 
__STATIC_INLINE void DL_AES_enableInterrupt (AES_Regs *aes)
 Enable AES Ready interrupt. More...
 
__STATIC_INLINE void DL_AES_enableDMATrigger0Interrupt (AES_Regs *aes)
 Enables DMA trigger 0 to publish AES events to the DMA. More...
 
__STATIC_INLINE void DL_AES_enableDMATrigger1Interrupt (AES_Regs *aes)
 Enables DMA trigger 1 to publish AES events to the DMA. More...
 
__STATIC_INLINE void DL_AES_enableDMATrigger2Interrupt (AES_Regs *aes)
 Enables DMA trigger 2 to publish AES events to the DMA. More...
 
__STATIC_INLINE void DL_AES_disableInterrupt (AES_Regs *aes)
 Disable AES Ready interrupt. More...
 
__STATIC_INLINE void DL_AES_disableDMATrigger0Event (AES_Regs *aes)
 Disable DMA Trigger 0 Event. More...
 
__STATIC_INLINE void DL_AES_disableDMATrigger1Event (AES_Regs *aes)
 Disable DMA Trigger 1 Event. More...
 
__STATIC_INLINE void DL_AES_disableDMATrigger2Event (AES_Regs *aes)
 Disable DMA Trigger 2 Event. More...
 
__STATIC_INLINE uint32_t DL_AES_getEnabledInterrupts (AES_Regs *aes)
 Check if AES Ready interrupt is enabled. More...
 
__STATIC_INLINE uint32_t DL_AES_getEnabledDMATrigger0Event (AES_Regs *aes)
 Check if DMA Trigger 0 Event is enabled. More...
 
__STATIC_INLINE uint32_t DL_AES_getEnabledDMATrigger1Event (AES_Regs *aes)
 Check if DMA Trigger 1 Event is enabled. More...
 
__STATIC_INLINE uint32_t DL_AES_getEnabledDMATrigger2Event (AES_Regs *aes)
 Check if DMA Trigger 2 Event is enabled. More...
 
__STATIC_INLINE uint32_t DL_AES_getEnabledInterruptStatus (AES_Regs *aes)
 Check interrupt flag of AES Ready interrupt. More...
 
__STATIC_INLINE uint32_t DL_AES_getEnabledDMATrigger0EventStatus (AES_Regs *aes)
 Check interrupt flag of DMA Trigger 0 Event. More...
 
__STATIC_INLINE uint32_t DL_AES_getEnabledDMATrigger1EventStatus (AES_Regs *aes)
 Check interrupt flag of DMA Trigger 1 Event. More...
 
__STATIC_INLINE uint32_t DL_AES_getEnabledDMATrigger2EventStatus (AES_Regs *aes)
 Check interrupt flag of DMA Trigger 2 Event. More...
 
__STATIC_INLINE uint32_t DL_AES_getRawInterruptStatus (AES_Regs *aes)
 Check interrupt flag of AES Ready interrupt. More...
 
__STATIC_INLINE uint32_t DL_AES_getRawDMATrigger0EventStatus (AES_Regs *aes)
 Check interrupt flag of DMA Trigger 0 Event. More...
 
__STATIC_INLINE uint32_t DL_AES_getRawDMATrigger1EventStatus (AES_Regs *aes)
 Check interrupt flag of DMA Trigger 1 Event. More...
 
__STATIC_INLINE uint32_t DL_AES_getRawDMATrigger2EventStatus (AES_Regs *aes)
 Check interrupt flag of DMA Trigger 2 Event. More...
 
__STATIC_INLINE DL_AES_IIDX DL_AES_getPendingInterrupt (AES_Regs *aes)
 Get highest priority pending AES interrupt. More...
 
__STATIC_INLINE DL_AES_IIDX DL_AES_getPendingDMATrigger0Event (AES_Regs *aes)
 Get highest priority pending DMA Trigger 0 Event. More...
 
__STATIC_INLINE DL_AES_IIDX DL_AES_getPendingDMATrigger1Event (AES_Regs *aes)
 Get highest priority pending DMA Trigger 1 Event. More...
 
__STATIC_INLINE DL_AES_IIDX DL_AES_getPendingDMATrigger2Event (AES_Regs *aes)
 Get highest priority pending DMA Trigger 2 Event. More...
 
__STATIC_INLINE void DL_AES_clearInterruptStatus (AES_Regs *aes)
 Clear pending AES Ready Interrupt. More...
 
__STATIC_INLINE void DL_AES_clearDMATrigger0EventStatus (AES_Regs *aes)
 Clear pending DMA Trigger 0 Event. More...
 
__STATIC_INLINE void DL_AES_clearDMATrigger1EventStatus (AES_Regs *aes)
 Clear pending DMA Trigger 1 Event. More...
 
__STATIC_INLINE void DL_AES_clearDMATrigger2EventStatus (AES_Regs *aes)
 Clear pending DMA Trigger 2 Event. More...
 
bool DL_AES_saveConfiguration (AES_Regs *aes, DL_AES_backupConfig *ptr)
 Save AES configuration before entering a power loss state. Note that operation-specific variables (intermediate data, key, IV) will need to be re-loaded after picking up the peripheral from a powerloss state. More...
 
bool DL_AES_restoreConfiguration (AES_Regs *aes, DL_AES_backupConfig *ptr)
 Restore AES configuration after leaving a power loss state. Note that operation-specific variables (intermediate data, key, IV) will need to be re-loaded after picking up the peripheral from a powerloss state. More...
 

Detailed Description

Overview

The AES DriverLib allows full configuration of the MSPM0 AES module. The AES accelerator module accelerates encryption and decryption operations in hardware based on the FIPS PUB 197 advanced encryption standard (AES).


Enumeration Type Documentation

§ DL_AES_MODE

Enumerator
DL_AES_MODE_ENCRYPT_ECB_MODE 

Selects encryption using Electronic Code Book (ECB) mode.

DL_AES_MODE_ENCRYPT_CBC_MODE 

Selects encryption using Cipher Block Chaining (CBC) mode.

DL_AES_MODE_ENCRYPT_OFB_MODE 

Selects encryption using Output Feedback (OFB) mode.

DL_AES_MODE_ENCRYPT_CFB_MODE 

Selects encryption using Cipher Feedback (CFB) mode.

DL_AES_MODE_DECRYPT_SAME_KEY_ECB_MODE 

Selects decryption using Electronic Code Book (ECB) mode.

DL_AES_MODE_DECRYPT_SAME_KEY_CBC_MODE 

Selects decryption using Cipher Block Chaining (CBC) mode.

DL_AES_MODE_DECRYPT_SAME_KEY_OFB_MODE 

Selects decryption using Output Feedback (OFB) mode.

DL_AES_MODE_DECRYPT_SAME_KEY_CFB_MODE 

Selects decryption using Cipher Feedback (CFB) mode.

DL_AES_MODE_GEN_FIRST_ROUND_KEY_ECB_MODE 

Selects first round key for Electronic Code Book (ECB) mode.

DL_AES_MODE_GEN_FIRST_ROUND_KEY_CBC_MODE 

Selects first round key using Cipher Block Chaining (CBC) mode.

DL_AES_MODE_GEN_FIRST_ROUND_KEY_OFB_MODE 

Selects first round key using Output Feedback (OFB) mode.

DL_AES_MODE_GEN_FIRST_ROUND_KEY_CFB_MODE 

Selects first round key using Cipher Feedback (CFB) mode.

DL_AES_MODE_DECRYPT_KEY_IS_FIRST_ROUND_KEY_ECB_MODE 

Selects decryption with 1st round key using ECB mode.

DL_AES_MODE_DECRYPT_KEY_IS_FIRST_ROUND_KEY_CBC_MODE 

Selects decryption with 1st round key using CBC mode.

DL_AES_MODE_DECRYPT_KEY_IS_FIRST_ROUND_KEY_OFB_MODE 

Selects decryption with 1st round key using OFB mode.

DL_AES_MODE_DECRYPT_KEY_IS_FIRST_ROUND_KEY_CFB_MODE 

Selects decryption with 1st round key using CFB mode.

§ DL_AES_IIDX

Enumerator
DL_AES_IIDX_AES_READY 

AES interrupt index for AES module ready

DL_AES_IIDX_AES_DMA_TRIGGER0 

AES interrupt index for enabling DMA trigger event 0

DL_AES_IIDX_AES_DMA_TRIGGER1 

AES interrupt index for enabling DMA trigger event 1

DL_AES_IIDX_AES_DMA_TRIGGER2 

AES interrupt index for enabling DMA trigger event 2

§ DL_AES_OPERATION

Enumerator
DL_AES_OPERATION_ENC 

Encryption mode selected

DL_AES_OPERATION_DEC_SAME_KEY 

Decryption. The provided key is the same key used for encryption.

DL_AES_OPERATION_GEN_FIRST_ROUND 

Generate first round key required for decryption.

DL_AES_OPERATION_DEC_KEY_IS_FIRST_ROUND 

Decryption. The provided key is the first round key required for decryption

§ DL_AES_KEY_LENGTH

Enumerator
DL_AES_KEY_LENGTH_128 

Key length set to 128

DL_AES_KEY_LENGTH_256 

Key length set to 256

§ DL_AES_STATUS

Enumerator
DL_AES_STATUS_SUCCESS 

Operation was successful

DL_AES_STATUS_UNALIGNED_ACCESS 

Operation was not performed because address was unaligned

Function Documentation

§ DL_AES_enablePower()

__STATIC_INLINE void DL_AES_enablePower ( AES_Regs *  aes)

Enables power on AES module.

Parameters
aesPointer to the register overlay for the peripheral

§ DL_AES_disablePower()

__STATIC_INLINE void DL_AES_disablePower ( AES_Regs *  aes)

Disables power on AES module.

Parameters
aesPointer to the register overlay for the peripheral

§ DL_AES_isPowerEnabled()

__STATIC_INLINE bool DL_AES_isPowerEnabled ( AES_Regs *  aes)

Returns if power enabled on AES module.

Parameters
aesPointer to the register overlay for the peripheral
Returns
true if power is enabled
false if power is disabled

§ DL_AES_reset()

__STATIC_INLINE void DL_AES_reset ( AES_Regs *  aes)

Resets AES peripheral.

Parameters
aesPointer to the register overlay for the peripheral

§ DL_AES_isReset()

__STATIC_INLINE bool DL_AES_isReset ( AES_Regs *  aes)

Returns if AES peripheral was reset.

Parameters
aesPointer to the register overlay for the peripheral
Returns
true if peripheral was reset
false if peripheral wasn't reset

§ DL_AES_init()

__STATIC_INLINE void DL_AES_init ( AES_Regs *  aes,
DL_AES_MODE  aesConfig,
DL_AES_KEY_LENGTH  keyLength 
)

Initializes AES peripheral.

Parameters
[in]aesPointer to the register overlay for the peripheral
[in]aesConfigConfigures AES cipher mode, key length and operation configuration. One of DL_AES_MODE
[in]keyLengthConfigures AES key length. One of DL_AES_KEY_LENGTH

References DL_Common_updateReg().

§ DL_AES_softwareReset()

__STATIC_INLINE void DL_AES_softwareReset ( AES_Regs *  aes)

Immediately resets the complete AES accelerator module even when busy.

Parameters
[in]aesPointer to the register overlay for the peripheral

§ DL_AES_isFaultFlagSet()

__STATIC_INLINE bool DL_AES_isFaultFlagSet ( AES_Regs *  aes)

Returns status of AES error flag.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
Status of AES module fault flag
Return values
trueflag is set
falseflag is cleared

§ DL_AES_clearFaultFlag()

__STATIC_INLINE void DL_AES_clearFaultFlag ( AES_Regs *  aes)

Clears AES error flag.

Parameters
[in]aesPointer to the register overlay for the peripheral

§ DL_AES_enableCipherMode()

__STATIC_INLINE void DL_AES_enableCipherMode ( AES_Regs *  aes)

Enables cipher mode.

Parameters
[in]aesPointer to the register overlay for the peripheral

§ DL_AES_disablesCipherMode()

__STATIC_INLINE void DL_AES_disablesCipherMode ( AES_Regs *  aes)

Disables cipher mode.

Parameters
[in]aesPointer to the register overlay for the peripheral

§ DL_AES_setCipherBlockCounter()

__STATIC_INLINE void DL_AES_setCipherBlockCounter ( AES_Regs *  aes,
uint32_t  count 
)

Set cipher block counter value.

Sets the number of blocks to be encrypted or decrypted, the block counter decrements with each performed encryption or decryption. Block cipher mode must be enabled with DL_AES_enableCipherMode. If block cipher mode is disabled, writes to this register are ignored. If this register has a value > 0 and block cipher mode has been enabled, further writes to this register are ignored until the value of this register is 0.

Parameters
aesPointer to the register overlay for the peripheral
[in]countThe value to set the cipher block counter to. Value between [0x0, 0xFF]
See also
DL_AES_enableCipherMode

References DL_Common_updateReg().

§ DL_AES_getCipherBlockCounter()

__STATIC_INLINE uint32_t DL_AES_getCipherBlockCounter ( AES_Regs *  aes)

Get current cipher block counter value.

The block counter decrements with each performed encryption or decryption.

Parameters
aesPointer to the register overlay for the peripheral
Returns
The current cipher block counter value
Return values
Valuebetween [0x0, 0xFF]

§ DL_AES_isBusy()

__STATIC_INLINE bool DL_AES_isBusy ( AES_Regs *  aes)

Gets the AES module busy status.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
Status of AES module
Return values
true.Module is busy
false.Module is in idle state

§ DL_AES_getDataOutReadStatus()

__STATIC_INLINE bool DL_AES_getDataOutReadStatus ( AES_Regs *  aes)

Gets the DATAOUT read status.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
Status of DATAOUT read status
Return values
true.All bytes read
false.Not all bytes read

§ DL_AES_getKeyBytesCount()

__STATIC_INLINE uint8_t DL_AES_getKeyBytesCount ( AES_Regs *  aes)

Gets Key byte count.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
Number of Key bytes loaded

§ DL_AES_getDataInBytesCount()

__STATIC_INLINE uint8_t DL_AES_getDataInBytesCount ( AES_Regs *  aes)

Gets Data In byte count.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
Number of Data In bytes loaded

§ DL_AES_getDataOutBytesCount()

__STATIC_INLINE uint8_t DL_AES_getDataOutBytesCount ( AES_Regs *  aes)

Gets Data Out byte count.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
Number of Data Out bytes loaded

§ DL_AES_setAllDataWritten()

__STATIC_INLINE void DL_AES_setAllDataWritten ( AES_Regs *  aes)

Set bit to write all STATE bytes to STATE registers and triggers a new encryption.

Parameters
[in]aesPointer to the register overlay for the peripheral

§ DL_AES_setAllKeyWritten()

__STATIC_INLINE void DL_AES_setAllKeyWritten ( AES_Regs *  aes)

Set bit to write all KEY bytes to KEY register, which is used to encrypt and decrypt data.

Parameters
[in]aesPointer to the register overlay for the peripheral

§ DL_AES_isAllDataWritten()

__STATIC_INLINE bool DL_AES_isAllDataWritten ( AES_Regs *  aes)

Check if all bytes are to be written to registers containing STATE info.

Parameters
[in]aesPointer to the register overlay for the peripheral
Return values
trueAll bytes are written to these registers
falseNot all bytes are written to these registers

§ DL_AES_isAllKeysWritten()

__STATIC_INLINE bool DL_AES_isAllKeysWritten ( AES_Regs *  aes)

Check if all bytes are to be written to registers containing KEY info.

Parameters
[in]aesPointer to the register overlay for the peripheral
Return values
trueAll bytes are written to these registers
falseNot all bytes are written to these registers

References DL_AES_getDataOut(), DL_AES_getDataOutAligned(), DL_AES_loadDataIn(), DL_AES_loadDataInAligned(), DL_AES_loadXORDataIn(), DL_AES_loadXORDataInAligned(), DL_AES_loadXORDataInWithoutTrigger(), DL_AES_loadXORDataInWithoutTriggerAligned(), DL_AES_setKey(), DL_AES_setKeyAligned(), DL_AES_xorData(), and DL_AES_xorDataAligned().

§ DL_AES_setKey()

DL_AES_STATUS DL_AES_setKey ( AES_Regs *  aes,
const uint8_t *  key,
DL_AES_KEY_LENGTH  keyLength 
)

Loads a 128 or 256 bit key to AES module.

Parameters
[in]aesPointer to the register overlay for the peripheral
[in]keyPointer to an aligned uint8_t array that contains the cipher key.
[in]keyLengthlength of the key. One of DL_AES_KEY_LENGTH
Returns
Status of operation. Operation will fail if not 32-bit aligned. One of DL_AES_STATUS.
Note
This function adds additional cycles in order to verify no unaligned access, if this is not necessary, consider using uint32_t pointers and DL_AES_setKeyAligned

Referenced by DL_AES_isAllKeysWritten().

§ DL_AES_setKeyAligned()

void DL_AES_setKeyAligned ( AES_Regs *  aes,
const uint32_t *  keyAligned,
DL_AES_KEY_LENGTH  keyLength 
)

Loads a 128 or 256 bit key to AES module.

Parameters
[in]aesPointer to the register overlay for the peripheral
[in]keyAlignedPointer to an uint32_t array that contains the cipher key.
[in]keyLengthlength of the key. One of DL_AES_KEY_LENGTH
See also
DL_AES_setKey

Referenced by DL_AES_isAllKeysWritten().

§ DL_AES_xorData()

DL_AES_STATUS DL_AES_xorData ( uint8_t *  data,
uint8_t *  xorData,
uint8_t *  xorOutputData 
)

XORs an AES 128-bit block of data in software.

Parameters
[in]dataPointer to initial data block for the operation
[in]xorDataPointer to 128-bit data block to xor with data
[out]xorOutputDataPointer to output block of data ^ xorData
Returns
Status of operation. Operation will fail if not 32-bit aligned. One of DL_AES_STATUS.
Note
This function adds additional cycles in order to verify no unaligned access, if this is not necessary, consider using uint32_t pointers and DL_AES_xorDataAligned

Referenced by DL_AES_isAllKeysWritten().

§ DL_AES_xorDataAligned()

void DL_AES_xorDataAligned ( uint32_t *  dataAligned,
uint32_t *  xorDataAligned,
uint32_t *  xorOutputDataAligned 
)

XORs an aligned 128-bit data block in software.

Parameters
[in]dataAlignedPointer to initial data block for the operation
[in]xorDataAlignedPointer to 128-bit data block to xor with data
[out]xorOutputDataAlignedPointer to output block of data ^ xorData
See also
DL_AES_xorData

Referenced by DL_AES_isAllKeysWritten().

§ DL_AES_loadDataIn()

DL_AES_STATUS DL_AES_loadDataIn ( AES_Regs *  aes,
const uint8_t *  data 
)

Encrypts a block of data using the AES module.

Parameters
[in]aesPointer to the register overlay for the peripheral
[in]dataIs a pointer to an aligned uint8_t array with a length of 16 that contains data to be encrypted.
Returns
Status of operation. Operation will fail if not 32-bit aligned. One of DL_AES_STATUS.
Note
This function adds additional cycles in order to verify no unaligned access, if this is not necessary, consider using uint32_t pointers and DL_AES_loadDataInAligned

Referenced by DL_AES_isAllKeysWritten().

§ DL_AES_loadDataInAligned()

void DL_AES_loadDataInAligned ( AES_Regs *  aes,
const uint32_t *  dataAligned 
)

Encrypts a block of data using the AES module.

Parameters
[in]aesPointer to the register overlay for the peripheral
[in]dataAlignedIs a pointer to an uint32_t array with a length of 4 that contains data to be encrypted.
See also
DL_AES_loadDataIn

Referenced by DL_AES_isAllKeysWritten().

§ DL_AES_getDataOut()

DL_AES_STATUS DL_AES_getDataOut ( AES_Regs *  aes,
uint8_t *  data 
)

Gets output of encrypted data.

Parameters
[in]aesPointer to the register overlay for the peripheral
[out]dataIs a pointer to an uint8_t array with a length of 16 where the output of the AES module will be placed.
Returns
Status of operation. Operation will fail if not 32-bit aligned. One of DL_AES_STATUS.
Note
This function adds additional cycles in order to verify no unaligned writes, if this is not necessary, consider using uint32_t pointers and DL_AES_getDataOutAligned

Referenced by DL_AES_isAllKeysWritten().

§ DL_AES_getDataOutAligned()

void DL_AES_getDataOutAligned ( AES_Regs *  aes,
uint32_t *  dataAligned 
)

Gets output of encrypted data.

Parameters
[in]aesPointer to the register overlay for the peripheral
[in]dataAlignedIs a pointer to an uint32_t array with a length of 4 where the output of the AES module will be placed.
See also
DL_AES_getDataOut

Referenced by DL_AES_isAllKeysWritten().

§ DL_AES_loadXORDataIn()

DL_AES_STATUS DL_AES_loadXORDataIn ( AES_Regs *  aes,
const uint8_t *  data 
)

Data is XORed with the current word of the state and then block of data is encrypted. Encryption or decryption is started immediately after loading data.

Parameters
[in]aesPointer to the register overlay for the peripheral
[in]dataIs a pointer to an aligned uint8_t array with a length of 16 that contains data to be encrypted.
Returns
Status of operation. Operation will fail if not 32-bit aligned. One of DL_AES_STATUS.
Note
This function adds additional cycles in order to verify no unaligned access, if this is not necessary, consider using uint32_t pointers and DL_AES_loadXORDataInAligned

Referenced by DL_AES_isAllKeysWritten().

§ DL_AES_loadXORDataInAligned()

void DL_AES_loadXORDataInAligned ( AES_Regs *  aes,
const uint32_t *  dataAligned 
)

Data is XORed with the current word of the state and then block of data is encrypted. Encryption or decryption is started immediately after loading data.

Parameters
[in]aesPointer to the register overlay for the peripheral
[in]dataAlignedIs a pointer to an uint32_t array with a length of 4 that contains data to be encrypted.
See also
DL_AES_loadXORDataIn

Referenced by DL_AES_isAllKeysWritten().

§ DL_AES_loadXORDataInWithoutTrigger()

DL_AES_STATUS DL_AES_loadXORDataInWithoutTrigger ( AES_Regs *  aes,
const uint8_t *  data 
)

Data is XORed with the current word of the state and then block of data is encrypted. Encryption or decryption is NOT started after loading data.

Parameters
[in]aesPointer to the register overlay for the peripheral
[in]dataIs a pointer to an aligned uint8_t array with a length of 16 that contains data to be encrypted.
Returns
Status of operation. Operation will fail if not 32-bit aligned. One of DL_AES_STATUS.
Note
This function adds additional cycles in order to verify no unaligned access, if this is not necessary, consider using uint32_t pointers and DL_AES_loadXORDataInWithoutTriggerAligned

Referenced by DL_AES_isAllKeysWritten().

§ DL_AES_loadXORDataInWithoutTriggerAligned()

void DL_AES_loadXORDataInWithoutTriggerAligned ( AES_Regs *  aes,
const uint32_t *  dataAligned 
)

Data is XORed with the current word of the state and then block of data is encrypted. Encryption or decryption is NOT started after loading data.

Parameters
[in]aesPointer to the register overlay for the peripheral
[in]dataAlignedIs a pointer to an uint32_t array with a length of 4 that contains data to be encrypted.
See also
DL_AES_loadXORDataInWithoutTrigger

Referenced by DL_AES_isAllKeysWritten().

§ DL_AES_enableInterrupt()

__STATIC_INLINE void DL_AES_enableInterrupt ( AES_Regs *  aes)

Enable AES Ready interrupt.

Parameters
[in]aesPointer to the register overlay for the peripheral

References DL_AES_INTERRUPT_AES_READY.

§ DL_AES_enableDMATrigger0Interrupt()

__STATIC_INLINE void DL_AES_enableDMATrigger0Interrupt ( AES_Regs *  aes)

Enables DMA trigger 0 to publish AES events to the DMA.

Parameters
[in]aesPointer to the register overlay for the peripheral

References DL_AES_EVENT_AES_DMA_TRIGGER0.

§ DL_AES_enableDMATrigger1Interrupt()

__STATIC_INLINE void DL_AES_enableDMATrigger1Interrupt ( AES_Regs *  aes)

Enables DMA trigger 1 to publish AES events to the DMA.

Parameters
[in]aesPointer to the register overlay for the peripheral

References DL_AES_EVENT_AES_DMA_TRIGGER1.

§ DL_AES_enableDMATrigger2Interrupt()

__STATIC_INLINE void DL_AES_enableDMATrigger2Interrupt ( AES_Regs *  aes)

Enables DMA trigger 2 to publish AES events to the DMA.

Parameters
[in]aesPointer to the register overlay for the peripheral

References DL_AES_EVENT_AES_DMA_TRIGGER2.

§ DL_AES_disableInterrupt()

__STATIC_INLINE void DL_AES_disableInterrupt ( AES_Regs *  aes)

Disable AES Ready interrupt.

Parameters
[in]aesPointer to the register overlay for the peripheral

§ DL_AES_disableDMATrigger0Event()

__STATIC_INLINE void DL_AES_disableDMATrigger0Event ( AES_Regs *  aes)

Disable DMA Trigger 0 Event.

Parameters
[in]aesPointer to the register overlay for the peripheral

§ DL_AES_disableDMATrigger1Event()

__STATIC_INLINE void DL_AES_disableDMATrigger1Event ( AES_Regs *  aes)

Disable DMA Trigger 1 Event.

Parameters
[in]aesPointer to the register overlay for the peripheral

§ DL_AES_disableDMATrigger2Event()

__STATIC_INLINE void DL_AES_disableDMATrigger2Event ( AES_Regs *  aes)

Disable DMA Trigger 2 Event.

Parameters
[in]aesPointer to the register overlay for the peripheral

§ DL_AES_getEnabledInterrupts()

__STATIC_INLINE uint32_t DL_AES_getEnabledInterrupts ( AES_Regs *  aes)

Check if AES Ready interrupt is enabled.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
If AES Ready interrupt is enabled
Return values
DL_AES_INTERRUPT_AES_READYif AES Ready interrupt is enabled
0if AES Ready interrupt is not enabled

§ DL_AES_getEnabledDMATrigger0Event()

__STATIC_INLINE uint32_t DL_AES_getEnabledDMATrigger0Event ( AES_Regs *  aes)

Check if DMA Trigger 0 Event is enabled.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
If DMA Trigger 0 Event is enabled
Return values
DL_AES_EVENT_AES_DMA_TRIGGER0if DMA Trigger 0 Event is enabled
0if DMA Trigger 0 Event is not enabled

§ DL_AES_getEnabledDMATrigger1Event()

__STATIC_INLINE uint32_t DL_AES_getEnabledDMATrigger1Event ( AES_Regs *  aes)

Check if DMA Trigger 1 Event is enabled.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
If DMA Trigger 1 Event is enabled
Return values
DL_AES_EVENT_AES_DMA_TRIGGER1if DMA Trigger 1 Event is enabled
0if DMA Trigger 1 Event is not enabled

§ DL_AES_getEnabledDMATrigger2Event()

__STATIC_INLINE uint32_t DL_AES_getEnabledDMATrigger2Event ( AES_Regs *  aes)

Check if DMA Trigger 2 Event is enabled.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
If DMA Trigger 2 Event is enabled
Return values
DL_AES_EVENT_AES_DMA_TRIGGER2if DMA Trigger 2 Event is enabled
0if DMA Trigger 2 Event is not enabled

§ DL_AES_getEnabledInterruptStatus()

__STATIC_INLINE uint32_t DL_AES_getEnabledInterruptStatus ( AES_Regs *  aes)

Check interrupt flag of AES Ready interrupt.

Checks if AES Ready interrupt that was previously enabled is pending.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
If AES Ready interrupt is pending
Return values
DL_AES_INTERRUPT_AES_READYif AES Ready interrupt is pending
0if AES Ready interrupt is not pending
See also
DL_AES_enableInterrupt

§ DL_AES_getEnabledDMATrigger0EventStatus()

__STATIC_INLINE uint32_t DL_AES_getEnabledDMATrigger0EventStatus ( AES_Regs *  aes)

Check interrupt flag of DMA Trigger 0 Event.

Checks if DMA Trigger 0 Event that was previously enabled is pending.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
If DMA Trigger 0 Event is pending
Return values
DL_AES_EVENT_AES_DMA_TRIGGER0if DMA Trigger 0 Event is pending
0if DMA Trigger 0 Event is not pending
See also
DL_AES_enableDMATrigger0Event

§ DL_AES_getEnabledDMATrigger1EventStatus()

__STATIC_INLINE uint32_t DL_AES_getEnabledDMATrigger1EventStatus ( AES_Regs *  aes)

Check interrupt flag of DMA Trigger 1 Event.

Checks if DMA Trigger 1 Event that was previously enabled is pending.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
If DMA Trigger 1 Event is pending
Return values
DL_AES_EVENT_AES_DMA_TRIGGER1if DMA Trigger 1 Event is pending
0if DMA Trigger 1 Event is not pending
See also
DL_AES_enableDMATrigger1Event

§ DL_AES_getEnabledDMATrigger2EventStatus()

__STATIC_INLINE uint32_t DL_AES_getEnabledDMATrigger2EventStatus ( AES_Regs *  aes)

Check interrupt flag of DMA Trigger 2 Event.

Checks if DMA Trigger 2 Event that was previously enabled is pending.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
If DMA Trigger 2 Event is pending
Return values
DL_AES_EVENT_AES_DMA_TRIGGER2if DMA Trigger 2 Event is pending
0if DMA Trigger 2 Event is not pending
See also
DL_AES_enableDMATrigger2Event

§ DL_AES_getRawInterruptStatus()

__STATIC_INLINE uint32_t DL_AES_getRawInterruptStatus ( AES_Regs *  aes)

Check interrupt flag of AES Ready interrupt.

Checks if AES Ready Interrupt is pending. Interrupt does not have to be previously enabled.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
If AES Ready interrupt is pending
Return values
DL_AES_EVENT_AES_DMA_TRIGGER0if AES Ready interrupt is pending
0if AES Ready interrupt is not pending

§ DL_AES_getRawDMATrigger0EventStatus()

__STATIC_INLINE uint32_t DL_AES_getRawDMATrigger0EventStatus ( AES_Regs *  aes)

Check interrupt flag of DMA Trigger 0 Event.

Checks if DMA Trigger 0 Event is pending. Event does not have to be previously enabled.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
If DMA Trigger 0 Event is pending
Return values
DL_AES_EVENT_AES_DMA_TRIGGER0if DMA Trigger 0 Event is pending
0if DMA Trigger 0 Event is not pending

§ DL_AES_getRawDMATrigger1EventStatus()

__STATIC_INLINE uint32_t DL_AES_getRawDMATrigger1EventStatus ( AES_Regs *  aes)

Check interrupt flag of DMA Trigger 1 Event.

Checks if DMA Trigger 1 Event is pending. Event does not have to be previously enabled.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
If DMA Trigger 1 Event is pending
Return values
DL_AES_EVENT_AES_DMA_TRIGGER0if DMA Trigger 1 Event is pending
0if DMA Trigger 1 Event is not pending

§ DL_AES_getRawDMATrigger2EventStatus()

__STATIC_INLINE uint32_t DL_AES_getRawDMATrigger2EventStatus ( AES_Regs *  aes)

Check interrupt flag of DMA Trigger 2 Event.

Checks if DMA Trigger 2 Event is pending. Event does not have to be previously enabled.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
If DMA Trigger 2 Event is pending
Return values
DL_AES_EVENT_AES_DMA_TRIGGER0if DMA Trigger 2 Event is pending
0if DMA Trigger 2 Event is not pending

§ DL_AES_getPendingInterrupt()

__STATIC_INLINE DL_AES_IIDX DL_AES_getPendingInterrupt ( AES_Regs *  aes)

Get highest priority pending AES interrupt.

Checks if AES Ready Interrupt is pending. Interrupt does not have to be previously enabled.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
The highest priority pending AES interrupt

§ DL_AES_getPendingDMATrigger0Event()

__STATIC_INLINE DL_AES_IIDX DL_AES_getPendingDMATrigger0Event ( AES_Regs *  aes)

Get highest priority pending DMA Trigger 0 Event.

Checks if DMA Trigger 0 Event os pending. Event does not have to be previously enabled.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
The highest priority pending DMA Trigger 0 Event

§ DL_AES_getPendingDMATrigger1Event()

__STATIC_INLINE DL_AES_IIDX DL_AES_getPendingDMATrigger1Event ( AES_Regs *  aes)

Get highest priority pending DMA Trigger 1 Event.

Checks if DMA Trigger 1 Event os pending. Event does not have to be previously enabled.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
The highest priority pending DMA Trigger 1 Event

§ DL_AES_getPendingDMATrigger2Event()

__STATIC_INLINE DL_AES_IIDX DL_AES_getPendingDMATrigger2Event ( AES_Regs *  aes)

Get highest priority pending DMA Trigger 2 Event.

Checks if DMA Trigger 2 Event os pending. Event does not have to be previously enabled.

Parameters
[in]aesPointer to the register overlay for the peripheral
Returns
The highest priority pending DMA Trigger 2 Event

§ DL_AES_clearInterruptStatus()

__STATIC_INLINE void DL_AES_clearInterruptStatus ( AES_Regs *  aes)

Clear pending AES Ready Interrupt.

Parameters
[in]aesPointer to the register overlay for the peripheral

§ DL_AES_clearDMATrigger0EventStatus()

__STATIC_INLINE void DL_AES_clearDMATrigger0EventStatus ( AES_Regs *  aes)

Clear pending DMA Trigger 0 Event.

Parameters
[in]aesPointer to the register overlay for the peripheral

§ DL_AES_clearDMATrigger1EventStatus()

__STATIC_INLINE void DL_AES_clearDMATrigger1EventStatus ( AES_Regs *  aes)

Clear pending DMA Trigger 1 Event.

Parameters
[in]aesPointer to the register overlay for the peripheral

§ DL_AES_clearDMATrigger2EventStatus()

__STATIC_INLINE void DL_AES_clearDMATrigger2EventStatus ( AES_Regs *  aes)

Clear pending DMA Trigger 2 Event.

Parameters
[in]aesPointer to the register overlay for the peripheral

References DL_AES_restoreConfiguration(), and DL_AES_saveConfiguration().

§ DL_AES_saveConfiguration()

bool DL_AES_saveConfiguration ( AES_Regs *  aes,
DL_AES_backupConfig ptr 
)

Save AES configuration before entering a power loss state. Note that operation-specific variables (intermediate data, key, IV) will need to be re-loaded after picking up the peripheral from a powerloss state.

Parameters
[in]aesPointer to the register overlay for the peripheral
[in]ptrConfiguration backup setup structure. See DL_AES_backupConfig.
Return values
FALSEif a configuration already exists in ptr (will not be overwritten). TRUE if a configuration was successfully saved

Referenced by DL_AES_clearDMATrigger2EventStatus().

§ DL_AES_restoreConfiguration()

bool DL_AES_restoreConfiguration ( AES_Regs *  aes,
DL_AES_backupConfig ptr 
)

Restore AES configuration after leaving a power loss state. Note that operation-specific variables (intermediate data, key, IV) will need to be re-loaded after picking up the peripheral from a powerloss state.

Parameters
[in]aesPointer to the register overlay for the peripheral
[in]ptrConfiguration backup setup structure. See DL_AES_backupConfig.
Return values
FALSEif a configuration does not exist in ptr (will not be loaded). TRUE if a configuration successfully loaded

Referenced by DL_AES_clearDMATrigger2EventStatus().

© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale