CC26xx Driver Library
[aes.h] Advanced Encryption Standard

Functions

void AESStartDMAOperation (const uint8_t *channel0Addr, uint32_t channel0Length, uint8_t *channel1Addr, uint32_t channel1Length)
 Start a crypto DMA operation. More...
 
void AESSetInitializationVector (const uint32_t *initializationVector)
 Write the initialization vector (IV) to the crypto module. More...
 
void AESReadNonAuthenticationModeIV (uint32_t *iv)
 Read the initialization vector (IV) out from the crypto module for Non-Authenticated Modes (CBC or CTR). More...
 
void AESReadAuthenticationModeIV (uint32_t *iv)
 Read the initialization vector (IV) out from the crypto module for Authenticated Modes (CCM or GCM). More...
 
void AESWriteCCMInitializationVector (const uint8_t *nonce, uint32_t nonceLength)
 Generate and load the initialization vector for a CCM operation. More...
 
uint32_t AESReadTag (uint8_t *tag, uint32_t tagLength)
 Read the tag out from the crypto module. More...
 
uint32_t AESVerifyTag (const uint8_t *tag, uint32_t tagLength)
 Verifies the provided tag against calculated one. More...
 
uint32_t AESWriteToKeyStore (const uint8_t *aesKey, uint32_t aesKeyLength, uint32_t keyStoreArea)
 Transfer a key from main memory to a key area within the key store. More...
 
uint32_t AESReadFromKeyStore (uint32_t keyStoreArea)
 Transfer a key from key store area to the internal buffers within the hardware module. More...
 
uint32_t AESWaitForIRQFlags (uint32_t irqFlags)
 Poll the interrupt status register and clear when done. More...
 
void AESConfigureCCMCtrl (uint32_t nonceLength, uint32_t macLength, bool encrypt)
 Configure AES engine for CCM operation. More...
 
static void AESInvalidateKey (uint32_t keyStoreArea)
 Invalidate a key in the key store. More...
 
static void AESSelectAlgorithm (uint32_t algorithm)
 Select type of operation. More...
 
static void AESSetCtrl (uint32_t ctrlMask)
 Set up the next crypto module operation. More...
 
static void AESSetDataLength (uint32_t length)
 Specify length of the crypto operation. More...
 
static void AESSetAuthLength (uint32_t length)
 Specify the length of the additional authentication data (AAD). More...
 
void AESReset (void)
 Reset the accelerator and cancel ongoing operations. More...
 
void AESDMAReset (void)
 Reset the accelerator DMA. More...
 
static void AESIntEnable (uint32_t intFlags)
 Enable individual crypto interrupt sources. More...
 
static void AESIntDisable (uint32_t intFlags)
 Disable individual crypto interrupt sources. More...
 
static uint32_t AESIntStatusMasked (void)
 Get the current masked interrupt status. More...
 
static uint32_t AESIntStatusRaw (void)
 Get the current raw interrupt status. More...
 
static void AESIntClear (uint32_t intFlags)
 Clear crypto interrupt sources. More...
 
static void AESIntRegister (void(*handlerFxn)(void))
 Register an interrupt handler for a crypto interrupt. More...
 
static void AESIntUnregister (void)
 Unregister an interrupt handler for a crypto interrupt. More...
 
static uint32_t AESGetCtrl (void)
 Read the Crypto module control and mode register value. More...
 
void AESWriteKey2 (const uint32_t *key2)
 Write the crypto module KEY2 registers. More...
 
void AESWriteKey3 (const uint32_t *key3)
 Write the crypto module KEY3 registers. More...
 
void AESClearDataIn (void)
 Clear the crypto module DATA_IN registers. More...
 
void AESWriteDataIn (const uint32_t *dataInBuffer)
 Write the crypto module DATA_IN registers. More...
 
void AESReadDataOut (uint32_t *dataOutBuffer)
 Read the crypto module DATA_OUT registers. More...
 
void AESClearKey2 (void)
 Clear the crypto module KEY2 registers. More...
 
void AESClearKey3 (void)
 Clear the crypto module KEY3 registers. More...
 
static void AESCBCMACClearKeys (void)
 Clear key registers as required for AES CBC-MAC. More...
 

Detailed Description

Introduction

The AES (advanced encryption standard) API provides access to the AES and key store functionality of the crypto core. The SHA2 accelerator is also contained within the crypto core. Hence, only one of SHA2 and AES may be used at the same time. This module offers hardware acceleration for several protocols using the AES block cypher. The protocols below are supported by the hardware. The driverlib documentation only explicitly references the most commonly used ones.

The key store is a section of crypto memory that is only accessible to the crypto module and may be written to by the application via the crypto DMA. It is not possible to read from the key store to main memory. Thereby, it is not possible to compromise the key should the application be hacked if the original key in main memory was overwritten already.

The crypto core does not have retention and all configuration settings and keys in the keystore are lost when going into standby or shutdown. The typical security advantages a key store offers are not available in these low power modes as the key must be saved in regular memory to reload it after going into standby or shutdown. Consequently, the keystore primarily serves as an interface to the AES accelerator.

Function Documentation

§ AESCBCMACClearKeys()

static void AESCBCMACClearKeys ( void  )
inlinestatic

Clear key registers as required for AES CBC-MAC.

Returns
None
889 {
890  AESClearKey2();
891  AESClearKey3();
892 }
void AESClearKey2(void)
Clear the crypto module KEY2 registers.
Definition: aes.c:478
void AESClearKey3(void)
Clear the crypto module KEY3 registers.
Definition: aes.c:490
Here is the call graph for this function:

§ AESClearDataIn()

void AESClearDataIn ( void  )

Clear the crypto module DATA_IN registers.

Returns
None

Referenced by AESGetCtrl().

442  {
443  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN0) = 0;
444  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN1) = 0;
445  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN2) = 0;
446  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN3) = 0;
447 }

§ AESClearKey2()

void AESClearKey2 ( void  )

Clear the crypto module KEY2 registers.

Returns
None

Referenced by AESCBCMACClearKeys(), and AESGetCtrl().

478  {
479  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY20) = 0;
480  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY21) = 0;
481  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY22) = 0;
482  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY23) = 0;
483 }

§ AESClearKey3()

void AESClearKey3 ( void  )

Clear the crypto module KEY3 registers.

Returns
None

Referenced by AESCBCMACClearKeys(), and AESGetCtrl().

490  {
491  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY30) = 0;
492  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY31) = 0;
493  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY32) = 0;
494  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY33) = 0;
495 }

§ AESConfigureCCMCtrl()

void AESConfigureCCMCtrl ( uint32_t  nonceLength,
uint32_t  macLength,
bool  encrypt 
)

Configure AES engine for CCM operation.

Parameters
[in]nonceLengthLength of the nonce. Must be <= 14.
[in]macLengthLength of the MAC. Must be <= 16.
[in]encryptWhether to set up an encrypt or decrypt operation.
  • true: encrypt
  • false: decrypt
Returns
None
378 {
379  uint32_t ctrlVal = 0;
380 
381  ctrlVal = ((15 - nonceLength - 1) << CRYPTO_AESCTL_CCM_L_S);
382  if ( macLength >= 2 ) {
383  ctrlVal |= ((( macLength - 2 ) >> 1 ) << CRYPTO_AESCTL_CCM_M_S );
384  }
385  ctrlVal |= CRYPTO_AESCTL_CCM |
386  CRYPTO_AESCTL_CTR |
387  CRYPTO_AESCTL_SAVE_CONTEXT |
388  CRYPTO_AESCTL_CTR_WIDTH_128_BIT;
389  ctrlVal |= encrypt ? CRYPTO_AESCTL_DIR : 0;
390 
391  AESSetCtrl(ctrlVal);
392 }
static void AESSetCtrl(uint32_t ctrlMask)
Set up the next crypto module operation.
Definition: aes.h:530
Here is the call graph for this function:

§ AESDMAReset()

void AESDMAReset ( void  )

Reset the accelerator DMA.

Returns
None
See also
AESReset

Referenced by AESSetAuthLength().

519 {
520  /* Reset DMA */
521  HWREG(CRYPTO_BASE + CRYPTO_O_DMASWRESET) = CRYPTO_DMASWRESET_SWRES;
522 
523  /* Wait for DMA channels to be inactive */
524  while (HWREG(CRYPTO_BASE + CRYPTO_O_DMASTAT) &
526 }
#define CRYPTO_DMASTAT_CH1_ACT
Definition: aes.c:85
#define CRYPTO_DMASWRESET_SWRES
Definition: aes.c:75
#define CRYPTO_DMASTAT_CH0_ACT
Definition: aes.c:80

§ AESGetCtrl()

static uint32_t AESGetCtrl ( void  )
inlinestatic

Read the Crypto module control and mode register value.

Returns
Returns the AES_CTL register value
800 {
801  return(HWREG(CRYPTO_BASE + CRYPTO_O_AESCTL));
802 }
Here is the call graph for this function:

§ AESIntClear()

static void AESIntClear ( uint32_t  intFlags)
inlinestatic

Clear crypto interrupt sources.

The specified crypto interrupt sources are cleared, so that they no longer assert. This function must be called in the interrupt handler to keep the interrupt from being recognized again immediately upon exit.

Note
Due to write buffers and synchronizers in the system it may take several clock cycles from a register write clearing an event in the module until the event is actually cleared in the NVIC of the system CPU. It is recommended to clear the event source early in the interrupt service routine (ISR) to allow the event clear to propagate to the NVIC before returning from the ISR.
Parameters
[in]intFlagsis a bit mask of the interrupt sources to be cleared.
Returns
None
728 {
729  // Check the arguments.
730  ASSERT((intFlags & AES_DMA_IN_DONE) ||
731  (intFlags & AES_RESULT_RDY));
732 
733  // Clear the requested interrupt sources,
734  HWREG(CRYPTO_BASE + CRYPTO_O_IRQCLR) = intFlags;
735 }
#define ASSERT(expr)
Definition: debug.h:71
#define AES_RESULT_RDY
Definition: aes.h:106
#define AES_DMA_IN_DONE
Definition: aes.h:105

§ AESIntDisable()

static void AESIntDisable ( uint32_t  intFlags)
inlinestatic

Disable individual crypto interrupt sources.

This function disables the indicated crypto interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt. Disabled sources have no effect on the processor.

Parameters
[in]intFlagsis the bitwise OR of the interrupt sources to be enabled.
Returns
None
655 {
656  // Check the arguments.
657  ASSERT((intFlags & AES_DMA_IN_DONE) ||
658  (intFlags & AES_RESULT_RDY));
659 
660  // Disable the specified interrupts.
661  HWREG(CRYPTO_BASE + CRYPTO_O_IRQEN) &= ~intFlags;
662 }
#define ASSERT(expr)
Definition: debug.h:71
#define AES_RESULT_RDY
Definition: aes.h:106
#define AES_DMA_IN_DONE
Definition: aes.h:105

§ AESIntEnable()

static void AESIntEnable ( uint32_t  intFlags)
inlinestatic

Enable individual crypto interrupt sources.

This function enables the indicated crypto interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt. Disabled sources have no effect on the processor.

Parameters
[in]intFlagsis the bitwise OR of the interrupt sources to be enabled.
Returns
None
627 {
628  // Check the arguments.
629  ASSERT((intFlags & AES_DMA_IN_DONE) ||
630  (intFlags & AES_RESULT_RDY));
631 
632  // Using level interrupt.
633  HWREG(CRYPTO_BASE + CRYPTO_O_IRQTYPE) = CRYPTO_IRQTYPE_LEVEL_M;
634 
635  // Enable the specified interrupts.
636  HWREG(CRYPTO_BASE + CRYPTO_O_IRQEN) |= intFlags;
637 }
#define ASSERT(expr)
Definition: debug.h:71
#define AES_RESULT_RDY
Definition: aes.h:106
#define AES_DMA_IN_DONE
Definition: aes.h:105

§ AESIntRegister()

static void AESIntRegister ( void(*)(void)  handlerFxn)
inlinestatic

Register an interrupt handler for a crypto interrupt.

This function does the actual registering of the interrupt handler. This function enables the global interrupt in the interrupt controller; specific crypto interrupts must be enabled via AESIntEnable(). It is the interrupt handler's responsibility to clear the interrupt source.

Parameters
handlerFxnis a pointer to the function to be called when the crypto interrupt occurs.
Returns
None
See also
IntRegister() for important information about registering interrupt handlers.
756 {
757  // Register the interrupt handler.
758  IntRegister(INT_CRYPTO_RESULT_AVAIL_IRQ, handlerFxn);
759 
760  // Enable the crypto interrupt.
761  IntEnable(INT_CRYPTO_RESULT_AVAIL_IRQ);
762 }
void IntRegister(uint32_t ui32Interrupt, void(*pfnHandler)(void))
Registers a function as an interrupt handler in the dynamic vector table.
Definition: interrupt.c:151
void IntEnable(uint32_t ui32Interrupt)
Enables an interrupt or system exception.
Definition: interrupt.c:281
Here is the call graph for this function:

§ AESIntStatusMasked()

static uint32_t AESIntStatusMasked ( void  )
inlinestatic

Get the current masked interrupt status.

This function returns the masked interrupt status of the crypto module.

Returns
Returns the status of the masked lines when enabled:
676 {
677  uint32_t mask;
678 
679  // Return the masked interrupt status
680  mask = HWREG(CRYPTO_BASE + CRYPTO_O_IRQEN);
681  return(mask & HWREG(CRYPTO_BASE + CRYPTO_O_IRQSTAT));
682 }

§ AESIntStatusRaw()

static uint32_t AESIntStatusRaw ( void  )
inlinestatic

Get the current raw interrupt status.

This function returns the raw interrupt status of the crypto module. It returns both the status of the lines routed to the NVIC as well as the error flags.

Returns
Returns the raw interrupt status:
701 {
702  // Return either the raw interrupt status
703  return(HWREG(CRYPTO_BASE + CRYPTO_O_IRQSTAT));
704 }

§ AESIntUnregister()

static void AESIntUnregister ( void  )
inlinestatic

Unregister an interrupt handler for a crypto interrupt.

This function does the actual unregistering of the interrupt handler. It clears the handler called when a crypto interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.

Returns
None
See also
IntRegister() for important information about registering interrupt handlers.
780 {
781  //
782  // Disable the interrupt.
783  //
784  IntDisable(INT_CRYPTO_RESULT_AVAIL_IRQ);
785 
786  //
787  // Unregister the interrupt handler.
788  //
789  IntUnregister(INT_CRYPTO_RESULT_AVAIL_IRQ);
790 }
void IntUnregister(uint32_t ui32Interrupt)
Unregisters an interrupt handler in the dynamic vector table.
Definition: interrupt.c:187
void IntDisable(uint32_t ui32Interrupt)
Disables an interrupt or system exception.
Definition: interrupt.c:325
Here is the call graph for this function:

§ AESInvalidateKey()

static void AESInvalidateKey ( uint32_t  keyStoreArea)
inlinestatic

Invalidate a key in the key store.

Parameters
[in]keyStoreAreais the entry in the key store to invalidate. This permanently deletes the key from the key store.
Returns
None

Referenced by AESWriteToKeyStore().

480 {
481  ASSERT((keyStoreArea == AES_KEY_AREA_0) ||
482  (keyStoreArea == AES_KEY_AREA_1) ||
483  (keyStoreArea == AES_KEY_AREA_2) ||
484  (keyStoreArea == AES_KEY_AREA_3) ||
485  (keyStoreArea == AES_KEY_AREA_4) ||
486  (keyStoreArea == AES_KEY_AREA_5) ||
487  (keyStoreArea == AES_KEY_AREA_6) ||
488  (keyStoreArea == AES_KEY_AREA_7));
489 
490  // Clear any previously written key at the key location
491  HWREG(CRYPTO_BASE + CRYPTO_O_KEYWRITTENAREA) = (0x00000001 << keyStoreArea);
492 }
#define AES_KEY_AREA_7
Definition: aes.h:157
#define AES_KEY_AREA_5
Definition: aes.h:155
#define AES_KEY_AREA_6
Definition: aes.h:156
#define AES_KEY_AREA_4
Definition: aes.h:154
#define AES_KEY_AREA_0
Definition: aes.h:150
#define ASSERT(expr)
Definition: debug.h:71
#define AES_KEY_AREA_1
Definition: aes.h:151
#define AES_KEY_AREA_3
Definition: aes.h:153
#define AES_KEY_AREA_2
Definition: aes.h:152

§ AESReadAuthenticationModeIV()

void AESReadAuthenticationModeIV ( uint32_t *  iv)

Read the initialization vector (IV) out from the crypto module for Authenticated Modes (CCM or GCM).

This function copies the IV calculated by the crypto module in CCM or GCM mode to iv.

Precondition
AESReadTag() must be called first.
Parameters
[out]ivPointer to an array with four 32-bit elements (16-bytes).
Returns
None
See also
AESReadTag()

Referenced by AESReadNonAuthenticationModeIV().

108 {
109  /* Read the computed IV out from the hw registers */
110  iv[0] = HWREG(CRYPTO_BASE + CRYPTO_O_AESIV0);
111  iv[1] = HWREG(CRYPTO_BASE + CRYPTO_O_AESIV1);
112  iv[2] = HWREG(CRYPTO_BASE + CRYPTO_O_AESIV2);
113  /* This read will clear the saved_context_ready bit
114  * and allow the AES core to start the next operation.
115  */
116  iv[3] = HWREG(CRYPTO_BASE + CRYPTO_O_AESIV3);
117 }

§ AESReadDataOut()

void AESReadDataOut ( uint32_t *  dataOutBuffer)

Read the crypto module DATA_OUT registers.

Parameters
[out]dataOutBufferPointer to the 4 x 32-bit buffer to output data from AES_DATA_OUT_0 .. AES_DATA_OUT_3 registers.
Returns
None

Referenced by AESGetCtrl().

466  {
467  dataOutBuffer[0] = HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAOUT0);
468  dataOutBuffer[1] = HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAOUT1);
469  dataOutBuffer[2] = HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAOUT2);
470  dataOutBuffer[3] = HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAOUT3);
471 }

§ AESReadFromKeyStore()

uint32_t AESReadFromKeyStore ( uint32_t  keyStoreArea)

Transfer a key from key store area to the internal buffers within the hardware module.

The function polls until the transfer is complete.

Parameters
[in]keyStoreAreaThe key store area to transfer the key from.
Returns
Returns a status code depending on the result of the transfer. When specifying a keyStoreArea value without a valid key in it an error is returned. If there was an error in the read process itself, an error is returned. Otherwise, a success code is returned.
See also
AESWriteToKeyStore
275 {
276  // Check the arguments.
277  ASSERT((keyStoreArea == AES_KEY_AREA_0) ||
278  (keyStoreArea == AES_KEY_AREA_1) ||
279  (keyStoreArea == AES_KEY_AREA_2) ||
280  (keyStoreArea == AES_KEY_AREA_3) ||
281  (keyStoreArea == AES_KEY_AREA_4) ||
282  (keyStoreArea == AES_KEY_AREA_5) ||
283  (keyStoreArea == AES_KEY_AREA_6) ||
284  (keyStoreArea == AES_KEY_AREA_7));
285 
286  // Check if there is a valid key in the specified keyStoreArea
287  if (!(HWREG(CRYPTO_BASE + CRYPTO_O_KEYWRITTENAREA) & (1 << keyStoreArea))) {
289  }
290 
291  // Enable keys to read (e.g. Key 0).
292  HWREG(CRYPTO_BASE + CRYPTO_O_KEYREADAREA) = keyStoreArea;
293 
294  // Wait until key is loaded to the AES module.
295  // We cannot simply poll the IRQ status as only an error is communicated through
296  // the IRQ status and not the completion of the transfer.
297  do {
298  CPUdelay(1);
299  }
300  while((HWREG(CRYPTO_BASE + CRYPTO_O_KEYREADAREA) & CRYPTO_KEYREADAREA_BUSY_M));
301 
302  // Check for keyStore read error.
303  if((HWREG(CRYPTO_BASE + CRYPTO_O_IRQSTAT) & CRYPTO_IRQSTAT_KEY_ST_RD_ERR_M)) {
304  return AES_KEYSTORE_ERROR;
305  }
306  else {
307  return AES_SUCCESS;
308  }
309 }
#define AES_KEY_AREA_7
Definition: aes.h:157
#define AES_SUCCESS
Definition: aes.h:119
#define AES_KEYSTORE_AREA_INVALID
Definition: aes.h:121
#define AES_KEY_AREA_5
Definition: aes.h:155
#define AES_KEYSTORE_ERROR
Definition: aes.h:120
#define AES_KEY_AREA_6
Definition: aes.h:156
#define AES_KEY_AREA_4
Definition: aes.h:154
#define AES_KEY_AREA_0
Definition: aes.h:150
#define ASSERT(expr)
Definition: debug.h:71
#define AES_KEY_AREA_1
Definition: aes.h:151
#define AES_KEY_AREA_3
Definition: aes.h:153
void CPUdelay(uint32_t ui32Count)
Provide a small non-zero delay using a simple loop counter.
Definition: cpu.c:342
#define AES_KEY_AREA_2
Definition: aes.h:152
Here is the call graph for this function:

§ AESReadNonAuthenticationModeIV()

void AESReadNonAuthenticationModeIV ( uint32_t *  iv)

Read the initialization vector (IV) out from the crypto module for Non-Authenticated Modes (CBC or CTR).

This function copies the IV calculated by the crypto module in CBC or CTR mode to iv.

Parameters
[out]ivPointer to an array with four 32-bit elements (16-bytes).
Returns
None
125 {
126  /* Wait until the saved context is ready */
127  while(!(HWREG(CRYPTO_BASE + CRYPTO_O_AESCTL) & CRYPTO_AESCTL_SAVED_CONTEXT_RDY_M));
128 
130 }
void AESReadAuthenticationModeIV(uint32_t *iv)
Read the initialization vector (IV) out from the crypto module for Authenticated Modes (CCM or GCM)...
Definition: aes.c:107
Here is the call graph for this function:

§ AESReadTag()

uint32_t AESReadTag ( uint8_t *  tag,
uint32_t  tagLength 
)

Read the tag out from the crypto module.

This function copies the tagLength bytes from the tag calculated by the crypto module in CCM, GCM, or CBC-MAC mode to tag.

Parameters
[out]tagPointer to an array of tagLength bytes.
[in]tagLengthNumber of bytes to copy to tag.
Returns
Returns a status code depending on the result of the transfer.

Referenced by AESVerifyTag().

317 {
318  // The intermediate array is used instead of a caller-provided one
319  // to enable a simple API with no unintuitive alignment or size requirements.
320  // This is a trade-off of stack-depth vs ease-of-use that came out on the
321  // ease-of-use side.
322  uint32_t computedTag[AES_BLOCK_SIZE / sizeof(uint32_t)];
323 
324  // Wait until the computed tag is ready.
325  while (!(HWREG(CRYPTO_BASE + CRYPTO_O_AESCTL) & CRYPTO_AESCTL_SAVED_CONTEXT_RDY_M));
326 
327  // Read computed tag out from the HW registers
328  // Need to read out all 128 bits in four reads to correctly clear CRYPTO_AESCTL_SAVED_CONTEXT_RDY flag
329  computedTag[0] = HWREG(CRYPTO_BASE + CRYPTO_O_AESTAGOUT0);
330  computedTag[1] = HWREG(CRYPTO_BASE + CRYPTO_O_AESTAGOUT1);
331  computedTag[2] = HWREG(CRYPTO_BASE + CRYPTO_O_AESTAGOUT2);
332  computedTag[3] = HWREG(CRYPTO_BASE + CRYPTO_O_AESTAGOUT3);
333 
334  memcpy(tag, computedTag, tagLength);
335 
336  return AES_SUCCESS;
337 }
#define AES_SUCCESS
Definition: aes.h:119
#define AES_BLOCK_SIZE
Definition: aes.h:132

§ AESReset()

void AESReset ( void  )

Reset the accelerator and cancel ongoing operations.

Precondition
AESDMAReset
Returns
None

Referenced by AESSetAuthLength().

504 {
505  /* Soft reset routine per SafeXcel */
506  HWREG(CRYPTO_BASE + CRYPTO_O_SWRESET) = CRYPTO_SWRESET_SW_RESET;
507  AESSetCtrl(0);
508  AESSetDataLength(0);
509  AESSetAuthLength(0);
510 
511 }
static void AESSetCtrl(uint32_t ctrlMask)
Set up the next crypto module operation.
Definition: aes.h:530
static void AESSetAuthLength(uint32_t length)
Specify the length of the additional authentication data (AAD).
Definition: aes.h:584
static void AESSetDataLength(uint32_t length)
Specify length of the crypto operation.
Definition: aes.h:557
#define CRYPTO_SWRESET_SW_RESET
Definition: aes.c:70
Here is the call graph for this function:

§ AESSelectAlgorithm()

static void AESSelectAlgorithm ( uint32_t  algorithm)
inlinestatic

Select type of operation.

Parameters
[in]algorithmFlags that specify which type of operation the crypto module shall perform. The flags are mutually exclusive.
Returns
None
509 {
510  ASSERT((algorithm == AES_ALGSEL_AES) ||
511  (algorithm == AES_ALGSEL_TAG) ||
512  (algorithm == AES_ALGSEL_KEY_STORE));
513 
514  HWREG(CRYPTO_BASE + CRYPTO_O_ALGSEL) = algorithm;
515 }
#define AES_ALGSEL_AES
Definition: aes.h:140
#define AES_ALGSEL_KEY_STORE
Definition: aes.h:141
#define ASSERT(expr)
Definition: debug.h:71
#define AES_ALGSEL_TAG
Definition: aes.h:142

§ AESSetAuthLength()

static void AESSetAuthLength ( uint32_t  length)
inlinestatic

Specify the length of the additional authentication data (AAD).

Despite specifying it here, the crypto DMA must still be set up with the correct AAD length.

Parameters
[in]lengthSpecifies how long the AAD is in a CCM operation. In CCM mode, set this to 0 if no AAD is required. If set to 0, AESWriteDataLength() must be set to >0. Range depends on the mode:
  • ECB: Do not call.
  • CBC: [0]
  • CBC-MAC: [0]
  • CCM: [0, sizeof(RAM)]
Returns
None
See also
AESWriteDataLength

Referenced by AESReset().

585 {
586  HWREG(CRYPTO_BASE + CRYPTO_O_AESAUTHLEN) = length;
587 }
Here is the call graph for this function:

§ AESSetCtrl()

static void AESSetCtrl ( uint32_t  ctrlMask)
inlinestatic

Set up the next crypto module operation.

The function uses a bitwise OR of the fields within the CRYPTO_O_AESCTL register. The relevant field names have the format:

  • CRYPTO_AESCTL_[field name]
Parameters
[in]ctrlMaskSpecifies which register fields shall be set.
Returns
None

Referenced by AESConfigureCCMCtrl(), and AESReset().

531 {
532  HWREG(CRYPTO_BASE + CRYPTO_O_AESCTL) = ctrlMask;
533 }

§ AESSetDataLength()

static void AESSetDataLength ( uint32_t  length)
inlinestatic

Specify length of the crypto operation.

Despite specifying it here, the crypto DMA must still be set up with the correct data length.

Parameters
[in]lengthData length in bytes. If this value is set to 0, only authentication of the AAD is performed in CCM-mode and AESWriteAuthLength() must be set to >0. Range depends on the mode:
  • ECB: [16]
  • CBC: [1, sizeof(RAM)]
  • CBC-MAC: [1, sizeof(RAM)]
  • CCM: [0, sizeof(RAM)]
Returns
None
See also
AESWriteAuthLength

Referenced by AESReset().

558 {
559  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATALEN0) = length;
560  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATALEN1) = 0;
561 }

§ AESSetInitializationVector()

void AESSetInitializationVector ( const uint32_t *  initializationVector)

Write the initialization vector (IV) to the crypto module.

Depending on the mode of operation, the tag must be constructed differently:

  • CBC: No special care must be taken. Any 128-bit IV (initialization vector) will suffice.
  • CBC-MAC: IV's must be all 0's.
  • CCM: Only 12 and 13 byte IV's are permitted. See code below for formatting.
    uint8_t initVectorLength = 12; // Could also be 13
    union {
    uint32_t word[4];
    uint8_t byte[16];
    } initVector;
    uint8_t initVectorUnformatted[initVectorLength];
    // This is the same field length value that is written to the ctrl register
    initVector.byte[0] = L - 1;
    memcpy(&initVector.byte[1], initVectorUnformatted, initVectorLength);
    // Fill the remaining bytes with zeros
    for (initVectorLength++; initVectorLength < sizeof(initVector.byte); initVectorLength++) {
    initVector.byte[initVectorLength] = 0;
    }
Parameters
[in]initializationVectorPointer to an array with four 32-bit elements to be used as initialization vector. Elements of array must be word aligned in memory.
Returns
None

Referenced by AESWriteCCMInitializationVector().

94 {
95  // Write initialization vector to the aes registers
96  HWREG(CRYPTO_BASE + CRYPTO_O_AESIV0) = initializationVector[0];
97  HWREG(CRYPTO_BASE + CRYPTO_O_AESIV1) = initializationVector[1];
98  HWREG(CRYPTO_BASE + CRYPTO_O_AESIV2) = initializationVector[2];
99  HWREG(CRYPTO_BASE + CRYPTO_O_AESIV3) = initializationVector[3];
100 }

§ AESStartDMAOperation()

void AESStartDMAOperation ( const uint8_t *  channel0Addr,
uint32_t  channel0Length,
uint8_t *  channel1Addr,
uint32_t  channel1Length 
)

Start a crypto DMA operation.

Enable the crypto DMA channels, configure the channel addresses, and set the length of the data transfer. Setting the length of the data transfer automatically starts the transfer. It is also used by the hardware module as a signal to begin the encryption, decryption, or MAC operation.

Parameters
[in]channel0AddrA pointer to the address channel 0 shall use.
[in]channel0LengthLength of the data in bytes to be read from or written to at channel0Addr. Set to 0 to not set up this channel. Permitted ranges are mode dependent and displayed below.
  • ECB: [16]
  • CBC: [1, sizeof(RAM)]
  • CBC-MAC: [1, sizeof(RAM)]
  • CCM: [1, sizeof(RAM)]
[out]channel1AddrA pointer to the address channel 1 shall use.
[in]channel1LengthLength of the data in bytes to be read from or written to at channel1Addr. Set to 0 to not set up this channel.Permitted ranges are mode dependent and displayed below.
  • ECB: [16]
  • CBC: [1, sizeof(RAM)]
  • CBC-MAC: [1, sizeof(RAM)]
  • CCM: [1, sizeof(RAM)]
Returns
None

Referenced by AESWriteToKeyStore().

138 {
139  if (channel0Length && channel0Addr) {
140  // We actually want to perform an operation. Clear any outstanding events.
141  HWREG(CRYPTO_BASE + CRYPTO_O_IRQCLR) = CRYPTO_IRQCLR_RESULT_AVAIL_M | CRYPTO_IRQEN_DMA_IN_DONE_M; // This might need AES_IRQEN_DMA_IN_DONE as well
142 
143  while(HWREG(CRYPTO_BASE + CRYPTO_O_IRQSTAT) & (CRYPTO_IRQSTAT_DMA_IN_DONE_M | CRYPTO_IRQSTAT_RESULT_AVAIL_M));
144 
145  // Configure the DMA controller - enable both DMA channels.
146  HWREGBITW(CRYPTO_BASE + CRYPTO_O_DMACH0CTL, CRYPTO_DMACH0CTL_EN_BITN) = 1;
147 
148  // Base address of the payload data in ext. memory.
149  HWREG(CRYPTO_BASE + CRYPTO_O_DMACH0EXTADDR) = (uint32_t)channel0Addr;
150 
151  // Payload data length in bytes, equal to the cipher text length.
152  HWREG(CRYPTO_BASE + CRYPTO_O_DMACH0LEN) = channel0Length;
153  }
154 
155  if (channel1Length && channel1Addr) {
156  // Enable DMA channel 1.
157  HWREGBITW(CRYPTO_BASE + CRYPTO_O_DMACH1CTL, CRYPTO_DMACH1CTL_EN_BITN) = 1;
158 
159  // Base address of the output data buffer.
160  HWREG(CRYPTO_BASE + CRYPTO_O_DMACH1EXTADDR) = (uint32_t)channel1Addr;
161 
162  // Output data length in bytes, equal to the cipher text length.
163  HWREG(CRYPTO_BASE + CRYPTO_O_DMACH1LEN) = channel1Length;
164  }
165 }

§ AESVerifyTag()

uint32_t AESVerifyTag ( const uint8_t *  tag,
uint32_t  tagLength 
)

Verifies the provided tag against calculated one.

This function compares the provided tag against the tag calculated by the crypto module during the last CCM, GCM, or CBC-MAC

This function copies the tagLength bytes from the tag calculated by the crypto module in CCM, GCM, or CBC-MAC mode to tag.

Parameters
[in]tagPointer to an array of tagLength bytes.
[in]tagLengthNumber of bytes to compare.
Returns
Returns a status code depending on the result of the transfer.
346 {
347  uint32_t resultStatus;
348  // The intermediate array is allocated on the stack to ensure users do not
349  // point the tag they provide and the one computed at the same location.
350  // That would cause memcmp to compare an array against itself. We could add
351  // a check that verifies that the arrays are not the same. If we did that and
352  // modified AESReadTag to just copy all 128 bits into a provided array,
353  // we could save 16 bytes of stack space while making the API much more
354  // complicated.
355  uint8_t computedTag[AES_BLOCK_SIZE];
356 
357  resultStatus = AESReadTag(computedTag, tagLength);
358 
359  if (resultStatus != AES_SUCCESS) {
360  return resultStatus;
361  }
362 
363  resultStatus = memcmp(computedTag, tag, tagLength);
364 
365  if (resultStatus != 0) {
367  }
368 
369  return AES_SUCCESS;
370 }
#define AES_SUCCESS
Definition: aes.h:119
#define AES_TAG_VERIFICATION_FAILED
Definition: aes.h:125
uint32_t AESReadTag(uint8_t *tag, uint32_t tagLength)
Read the tag out from the crypto module.
Definition: aes.c:316
#define AES_BLOCK_SIZE
Definition: aes.h:132
Here is the call graph for this function:

§ AESWaitForIRQFlags()

uint32_t AESWaitForIRQFlags ( uint32_t  irqFlags)

Poll the interrupt status register and clear when done.

This function polls until one of the bits in the irqFlags is asserted. Only AES_DMA_IN_DONE and AES_RESULT_RDY can actually trigger the interrupt line. That means that one of those should always be included in irqFlags and will always be returned together with any error codes.

Parameters
[in]irqFlagsIRQ flags to poll and mask that the status register will be masked with. May consist of any bitwise OR of the flags below that includes at least one of AES_DMA_IN_DONE or AES_RESULT_RDY :
Returns
Returns the IRQ status register masked with irqFlags. May be any bitwise OR of the following masks:

Referenced by AESWriteToKeyStore().

173 {
174  uint32_t irqTrigger = 0;
175  // Wait for the DMA operation to complete. Add a delay to make sure we are
176  // not flooding the bus with requests too much.
177  do {
178  CPUdelay(1);
179  }
180  while(!(HWREG(CRYPTO_BASE + CRYPTO_O_IRQSTAT) & irqFlags & (CRYPTO_IRQSTAT_DMA_IN_DONE_M |
181  CRYPTO_IRQSTAT_RESULT_AVAIL_M |
182  CRYPTO_IRQSTAT_DMA_BUS_ERR_M |
183  CRYPTO_IRQSTAT_KEY_ST_WR_ERR_M)));
184 
185  // Save the IRQ trigger source
186  irqTrigger = HWREG(CRYPTO_BASE + CRYPTO_O_IRQSTAT) & irqFlags;
187 
188  // Clear IRQ flags
189  HWREG(CRYPTO_BASE + CRYPTO_O_IRQCLR) = irqTrigger;
190 
191  return irqTrigger;
192 }
void CPUdelay(uint32_t ui32Count)
Provide a small non-zero delay using a simple loop counter.
Definition: cpu.c:342
Here is the call graph for this function:

§ AESWriteCCMInitializationVector()

void AESWriteCCMInitializationVector ( const uint8_t *  nonce,
uint32_t  nonceLength 
)

Generate and load the initialization vector for a CCM operation.

Parameters
[in]noncePointer to a nonce of length nonceLength.
[in]nonceLengthNumber of bytes to copy from nonce when creating the CCM IV. The L-value is also derived from it.
Returns
None
400 {
401  union {
402  uint32_t word[4];
403  uint8_t byte[16];
404  } initializationVector = {{0}};
405 
406  initializationVector.byte[0] = 15 - nonceLength - 1;
407 
408  memcpy(&(initializationVector.byte[1]), nonce, nonceLength);
409 
410  AESSetInitializationVector(initializationVector.word);
411 }
void AESSetInitializationVector(const uint32_t *initializationVector)
Write the initialization vector (IV) to the crypto module.
Definition: aes.c:93
Here is the call graph for this function:

§ AESWriteDataIn()

void AESWriteDataIn ( const uint32_t *  dataInBuffer)

Write the crypto module DATA_IN registers.

Parameters
[in]dataInBufferPointer to the 4 x 32-bit buffer containing data to be written to AES_DATA_IN_0 .. AES_DATA_IN_3 registers.
Returns
None

Referenced by AESGetCtrl().

454  {
455  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN0) = dataInBuffer[0];
456  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN1) = dataInBuffer[1];
457  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN2) = dataInBuffer[2];
458  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN3) = dataInBuffer[3];
459 }

§ AESWriteKey2()

void AESWriteKey2 ( const uint32_t *  key2)

Write the crypto module KEY2 registers.

Parameters
[in]key2Pointer to the 4 x 32-bit key-material to be written to AES_KEY2_0 .. AES_KEY2_3 registers.
Returns
None

Referenced by AESGetCtrl().

418  {
419  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY20) = key2[0];
420  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY21) = key2[1];
421  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY22) = key2[2];
422  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY23) = key2[3];
423 }

§ AESWriteKey3()

void AESWriteKey3 ( const uint32_t *  key3)

Write the crypto module KEY3 registers.

Parameters
[in]key3Pointer to the 4 x 32-bit key-material to be written to AES_KEY3_0 .. AES_KEY3_3 registers.
Returns
None

Referenced by AESGetCtrl().

430  {
431  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY30) = key3[0];
432  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY31) = key3[1];
433  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY32) = key3[2];
434  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY33) = key3[3];
435 }

§ AESWriteToKeyStore()

uint32_t AESWriteToKeyStore ( const uint8_t *  aesKey,
uint32_t  aesKeyLength,
uint32_t  keyStoreArea 
)

Transfer a key from main memory to a key area within the key store.

The crypto DMA transfers the key and function does not return until the operation completes.

Parameters
[in]aesKeyPointer to key. Does not need to be word-aligned.
[in]aesKeyLengthThe key size in bytes. 128-bit keys are supported.
[in]keyStoreAreaThe key store area to transfer the key to. When using 128-bit keys, only the specified key store area will be occupied.
Returns
Returns a status code depending on the result of the transfer. If there was an error in the read process itself, an error is returned. Otherwise, a success code is returned.
See also
AESReadFromKeyStore
200 {
201  // Check the arguments.
202  ASSERT((keyStoreArea == AES_KEY_AREA_0) ||
203  (keyStoreArea == AES_KEY_AREA_1) ||
204  (keyStoreArea == AES_KEY_AREA_2) ||
205  (keyStoreArea == AES_KEY_AREA_3) ||
206  (keyStoreArea == AES_KEY_AREA_4) ||
207  (keyStoreArea == AES_KEY_AREA_5) ||
208  (keyStoreArea == AES_KEY_AREA_6) ||
209  (keyStoreArea == AES_KEY_AREA_7));
210 
211  ASSERT((aesKeyLength == AES_128_KEY_LENGTH_BYTES));
212 
213  uint32_t keySize = 0;
214 
215  switch (aesKeyLength) {
217  keySize = CRYPTO_KEYSIZE_SIZE_128_BIT;
218  break;
219  }
220 
221  // Clear any previously written key at the keyLocation
222  AESInvalidateKey(keyStoreArea);
223 
224  // Disable the external interrupt to stop the interrupt form propagating
225  // from the module to the System CPU.
226  IntDisable(INT_CRYPTO_RESULT_AVAIL_IRQ);
227 
228  // Enable internal interrupts.
229  HWREG(CRYPTO_BASE + CRYPTO_O_IRQTYPE) = CRYPTO_IRQTYPE_LEVEL_M;
230  HWREG(CRYPTO_BASE + CRYPTO_O_IRQEN) = CRYPTO_IRQEN_DMA_IN_DONE_M | CRYPTO_IRQEN_RESULT_AVAIL_M;
231 
232  // Configure master control module.
233  HWREG(CRYPTO_BASE + CRYPTO_O_ALGSEL) = CRYPTO_ALGSEL_KEY_STORE;
234 
235  // Clear any outstanding events.
236  HWREG(CRYPTO_BASE + CRYPTO_O_IRQCLR) = (CRYPTO_IRQCLR_DMA_IN_DONE | CRYPTO_IRQCLR_RESULT_AVAIL);
237 
238  // Configure the size of keys contained within the key store
239  // Do not write to the register if the correct key size is already set.
240  // Writing to this register causes all current keys to be invalidated.
241  uint32_t keyStoreKeySize = HWREG(CRYPTO_BASE + CRYPTO_O_KEYSIZE);
242  if (keySize != keyStoreKeySize) {
243  HWREG(CRYPTO_BASE + CRYPTO_O_KEYSIZE) = keySize;
244  }
245 
246  // Enable key to write (e.g. Key 0).
247  HWREG(CRYPTO_BASE + CRYPTO_O_KEYWRITEAREA) = 1 << keyStoreArea;
248 
249  // Total key length in bytes (16 for 1 x 128-bit key).
251 
252  // Wait for the DMA operation to complete.
253  uint32_t irqTrigger = AESWaitForIRQFlags(CRYPTO_IRQCLR_RESULT_AVAIL | CRYPTO_IRQCLR_DMA_IN_DONE | CRYPTO_IRQSTAT_DMA_BUS_ERR | CRYPTO_IRQSTAT_KEY_ST_WR_ERR);
254 
255  // Re-enable interrupts globally.
256  IntPendClear(INT_CRYPTO_RESULT_AVAIL_IRQ);
257  IntEnable(INT_CRYPTO_RESULT_AVAIL_IRQ);
258 
259  // If we had a bus error or the key is not in the CRYPTO_O_KEYWRITTENAREA, return an error.
260  if ((irqTrigger & (CRYPTO_IRQSTAT_DMA_BUS_ERR_M | CRYPTO_IRQSTAT_KEY_ST_WR_ERR_M)) || !(HWREG(CRYPTO_BASE + CRYPTO_O_KEYWRITTENAREA) & (1 << keyStoreArea))) {
261  // There was an error in writing to the keyStore.
262  return AES_KEYSTORE_ERROR;
263  }
264  else {
265  return AES_SUCCESS;
266  }
267 }
uint32_t AESWaitForIRQFlags(uint32_t irqFlags)
Poll the interrupt status register and clear when done.
Definition: aes.c:172
void IntPendClear(uint32_t ui32Interrupt)
Unpends an interrupt.
Definition: interrupt.c:441
#define AES_KEY_AREA_7
Definition: aes.h:157
#define AES_SUCCESS
Definition: aes.h:119
#define AES_KEY_AREA_5
Definition: aes.h:155
#define AES_KEYSTORE_ERROR
Definition: aes.h:120
#define AES_KEY_AREA_6
Definition: aes.h:156
#define AES_KEY_AREA_4
Definition: aes.h:154
#define AES_KEY_AREA_0
Definition: aes.h:150
#define ASSERT(expr)
Definition: debug.h:71
static void AESInvalidateKey(uint32_t keyStoreArea)
Invalidate a key in the key store.
Definition: aes.h:479
#define AES_KEY_AREA_1
Definition: aes.h:151
#define AES_128_KEY_LENGTH_BYTES
Definition: aes.h:130
#define AES_KEY_AREA_3
Definition: aes.h:153
void AESStartDMAOperation(const uint8_t *channel0Addr, uint32_t channel0Length, uint8_t *channel1Addr, uint32_t channel1Length)
Start a crypto DMA operation.
Definition: aes.c:137
#define AES_KEY_AREA_2
Definition: aes.h:152
void IntDisable(uint32_t ui32Interrupt)
Disables an interrupt or system exception.
Definition: interrupt.c:325
void IntEnable(uint32_t ui32Interrupt)
Enables an interrupt or system exception.
Definition: interrupt.c:281
Here is the call graph for this function:

Macro Definition Documentation

§ AES_128_KEY_LENGTH_BYTES

#define AES_128_KEY_LENGTH_BYTES   (128 / 8)

Referenced by AESWriteToKeyStore().

§ AES_ALGSEL_AES

#define AES_ALGSEL_AES   CRYPTO_ALGSEL_AES_M

Referenced by AESSelectAlgorithm().

§ AES_ALGSEL_KEY_STORE

#define AES_ALGSEL_KEY_STORE   CRYPTO_ALGSEL_KEY_STORE_M

Referenced by AESSelectAlgorithm().

§ AES_ALGSEL_TAG

#define AES_ALGSEL_TAG   CRYPTO_ALGSEL_TAG_M

Referenced by AESSelectAlgorithm().

§ AES_BLOCK_SIZE

#define AES_BLOCK_SIZE   16

Referenced by AESReadTag(), and AESVerifyTag().

§ AES_CTR_WIDTH_128

#define AES_CTR_WIDTH_128   0x3

§ AES_CTR_WIDTH_32

#define AES_CTR_WIDTH_32   0x0

§ AES_CTR_WIDTH_64

#define AES_CTR_WIDTH_64   0x1

§ AES_CTR_WIDTH_96

#define AES_CTR_WIDTH_96   0x2

§ AES_DMA_BUS_ERR

#define AES_DMA_BUS_ERR   CRYPTO_IRQCLR_DMA_BUS_ERR_M

§ AES_DMA_BUSY

#define AES_DMA_BUSY   3

§ AES_DMA_CHANNEL0_ACTIVE

#define AES_DMA_CHANNEL0_ACTIVE   CRYPTO_DMASTAT_CH0_ACT_M

§ AES_DMA_CHANNEL1_ACTIVE

#define AES_DMA_CHANNEL1_ACTIVE   CRYPTO_DMASTAT_CH1_ACT_M

§ AES_DMA_ERROR

#define AES_DMA_ERROR   4

§ AES_DMA_IN_DONE

#define AES_DMA_IN_DONE   CRYPTO_IRQEN_DMA_IN_DONE_M

§ AES_DMA_PORT_ERROR

#define AES_DMA_PORT_ERROR   CRYPTO_DMASTAT_PORT_ERR_M

§ AES_IV_LENGTH_BYTES

#define AES_IV_LENGTH_BYTES   16

§ AES_KEY_AREA_0

#define AES_KEY_AREA_0   0

§ AES_KEY_AREA_1

#define AES_KEY_AREA_1   1

§ AES_KEY_AREA_2

#define AES_KEY_AREA_2   2

§ AES_KEY_AREA_3

#define AES_KEY_AREA_3   3

§ AES_KEY_AREA_4

#define AES_KEY_AREA_4   4

§ AES_KEY_AREA_5

#define AES_KEY_AREA_5   5

§ AES_KEY_AREA_6

#define AES_KEY_AREA_6   6

§ AES_KEY_AREA_7

#define AES_KEY_AREA_7   7

§ AES_KEY_ST_RD_ERR

#define AES_KEY_ST_RD_ERR   CRYPTO_IRQCLR_KEY_ST_RD_ERR_M

§ AES_KEY_ST_WR_ERR

#define AES_KEY_ST_WR_ERR   CRYPTO_IRQCLR_KEY_ST_WR_ERR_M

§ AES_KEYSTORE_AREA_INVALID

#define AES_KEYSTORE_AREA_INVALID   2

Referenced by AESReadFromKeyStore().

§ AES_KEYSTORE_ERROR

#define AES_KEYSTORE_ERROR   1

§ AES_RESULT_RDY

#define AES_RESULT_RDY   CRYPTO_IRQEN_RESULT_AVAIL_M

§ AES_SUCCESS

#define AES_SUCCESS   0

§ AES_TAG_LENGTH_BYTES

#define AES_TAG_LENGTH_BYTES   16

§ AES_TAG_NOT_READY

#define AES_TAG_NOT_READY   5

§ AES_TAG_VERIFICATION_FAILED

#define AES_TAG_VERIFICATION_FAILED   6

Referenced by AESVerifyTag().