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
920 {
921  AESClearKey2();
922  AESClearKey3();
923 }
void AESClearKey2(void)
Clear the crypto module KEY2 registers.
Definition: aes.c:499
void AESClearKey3(void)
Clear the crypto module KEY3 registers.
Definition: aes.c:511
Here is the call graph for this function:

§ AESClearDataIn()

void AESClearDataIn ( void  )

Clear the crypto module DATA_IN registers.

Returns
None

Referenced by AESGetCtrl().

463  {
464  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN0) = 0;
465  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN1) = 0;
466  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN2) = 0;
467  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN3) = 0;
468 }

§ AESClearKey2()

void AESClearKey2 ( void  )

Clear the crypto module KEY2 registers.

Returns
None

Referenced by AESCBCMACClearKeys(), and AESGetCtrl().

499  {
500  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY20) = 0;
501  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY21) = 0;
502  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY22) = 0;
503  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY23) = 0;
504 }

§ AESClearKey3()

void AESClearKey3 ( void  )

Clear the crypto module KEY3 registers.

Returns
None

Referenced by AESCBCMACClearKeys(), and AESGetCtrl().

511  {
512  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY30) = 0;
513  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY31) = 0;
514  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY32) = 0;
515  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY33) = 0;
516 }

§ 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
399 {
400  uint32_t ctrlVal = 0;
401 
402  ctrlVal = ((15 - nonceLength - 1) << CRYPTO_AESCTL_CCM_L_S);
403  if ( macLength >= 2 ) {
404  ctrlVal |= ((( macLength - 2 ) >> 1 ) << CRYPTO_AESCTL_CCM_M_S );
405  }
406  ctrlVal |= CRYPTO_AESCTL_CCM |
407  CRYPTO_AESCTL_CTR |
408  CRYPTO_AESCTL_SAVE_CONTEXT |
409  CRYPTO_AESCTL_CTR_WIDTH_128_BIT;
410  ctrlVal |= encrypt ? CRYPTO_AESCTL_DIR : 0;
411 
412  AESSetCtrl(ctrlVal);
413 }
static void AESSetCtrl(uint32_t ctrlMask)
Set up the next crypto module operation.
Definition: aes.h:561
Here is the call graph for this function:

§ AESDMAReset()

void AESDMAReset ( void  )

Reset the accelerator DMA.

Returns
None
See also
AESReset

Referenced by AESSetAuthLength().

544 {
545  /* Reset DMA */
546  HWREG(CRYPTO_BASE + CRYPTO_O_DMASWRESET) = CRYPTO_DMASWRESET_SWRES;
547 
548  /* Wait for DMA channels to be inactive */
549  while (HWREG(CRYPTO_BASE + CRYPTO_O_DMASTAT) &
550  (CRYPTO_DMASTAT_CH0_ACT | CRYPTO_DMASTAT_CH1_ACT));
551 }

§ AESGetCtrl()

static uint32_t AESGetCtrl ( void  )
inlinestatic

Read the Crypto module control and mode register value.

Returns
Returns the AES_CTL register value
831 {
832  return(HWREG(CRYPTO_BASE + CRYPTO_O_AESCTL));
833 }
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
759 {
760  // Check the arguments.
761  ASSERT((intFlags & AES_DMA_IN_DONE) ||
762  (intFlags & AES_RESULT_RDY));
763 
764  // Clear the requested interrupt sources,
765  HWREG(CRYPTO_BASE + CRYPTO_O_IRQCLR) = intFlags;
766 }
#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
686 {
687  // Check the arguments.
688  ASSERT((intFlags & AES_DMA_IN_DONE) ||
689  (intFlags & AES_RESULT_RDY));
690 
691  // Disable the specified interrupts.
692  HWREG(CRYPTO_BASE + CRYPTO_O_IRQEN) &= ~intFlags;
693 }
#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
658 {
659  // Check the arguments.
660  ASSERT((intFlags & AES_DMA_IN_DONE) ||
661  (intFlags & AES_RESULT_RDY));
662 
663  // Using level interrupt.
664  HWREG(CRYPTO_BASE + CRYPTO_O_IRQTYPE) = CRYPTO_IRQTYPE_LEVEL_M;
665 
666  // Enable the specified interrupts.
667  HWREG(CRYPTO_BASE + CRYPTO_O_IRQEN) |= intFlags;
668 }
#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.
787 {
788  // Register the interrupt handler.
789  IntRegister(INT_CRYPTO_RESULT_AVAIL_IRQ, handlerFxn);
790 
791  // Enable the crypto interrupt.
792  IntEnable(INT_CRYPTO_RESULT_AVAIL_IRQ);
793 }
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:
707 {
708  uint32_t mask;
709 
710  // Return the masked interrupt status
711  mask = HWREG(CRYPTO_BASE + CRYPTO_O_IRQEN);
712  return(mask & HWREG(CRYPTO_BASE + CRYPTO_O_IRQSTAT));
713 }

§ 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:
732 {
733  // Return either the raw interrupt status
734  return(HWREG(CRYPTO_BASE + CRYPTO_O_IRQSTAT));
735 }

§ 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.
811 {
812  //
813  // Disable the interrupt.
814  //
815  IntDisable(INT_CRYPTO_RESULT_AVAIL_IRQ);
816 
817  //
818  // Unregister the interrupt handler.
819  //
820  IntUnregister(INT_CRYPTO_RESULT_AVAIL_IRQ);
821 }
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().

511 {
512  ASSERT((keyStoreArea == AES_KEY_AREA_0) ||
513  (keyStoreArea == AES_KEY_AREA_1) ||
514  (keyStoreArea == AES_KEY_AREA_2) ||
515  (keyStoreArea == AES_KEY_AREA_3) ||
516  (keyStoreArea == AES_KEY_AREA_4) ||
517  (keyStoreArea == AES_KEY_AREA_5) ||
518  (keyStoreArea == AES_KEY_AREA_6) ||
519  (keyStoreArea == AES_KEY_AREA_7));
520 
521  // Clear any previously written key at the key location
522  HWREG(CRYPTO_BASE + CRYPTO_O_KEYWRITTENAREA) = (0x00000001 << keyStoreArea);
523 }
#define AES_KEY_AREA_7
Definition: aes.h:161
#define AES_KEY_AREA_5
Definition: aes.h:159
#define AES_KEY_AREA_6
Definition: aes.h:160
#define AES_KEY_AREA_4
Definition: aes.h:158
#define AES_KEY_AREA_0
Definition: aes.h:154
#define ASSERT(expr)
Definition: debug.h:71
#define AES_KEY_AREA_1
Definition: aes.h:155
#define AES_KEY_AREA_3
Definition: aes.h:157
#define AES_KEY_AREA_2
Definition: aes.h:156

§ 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().

487  {
488  dataOutBuffer[0] = HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAOUT0);
489  dataOutBuffer[1] = HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAOUT1);
490  dataOutBuffer[2] = HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAOUT2);
491  dataOutBuffer[3] = HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAOUT3);
492 }

§ 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. When using 256-bit keys, either of the occupied key areas may be specified to load the key. There is no need to specify the length of the key here as the key store keeps track of how long a key associated with any valid key area is and where is starts.
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
296 {
297  // Check the arguments.
298  ASSERT((keyStoreArea == AES_KEY_AREA_0) ||
299  (keyStoreArea == AES_KEY_AREA_1) ||
300  (keyStoreArea == AES_KEY_AREA_2) ||
301  (keyStoreArea == AES_KEY_AREA_3) ||
302  (keyStoreArea == AES_KEY_AREA_4) ||
303  (keyStoreArea == AES_KEY_AREA_5) ||
304  (keyStoreArea == AES_KEY_AREA_6) ||
305  (keyStoreArea == AES_KEY_AREA_7));
306 
307  // Check if there is a valid key in the specified keyStoreArea
308  if (!(HWREG(CRYPTO_BASE + CRYPTO_O_KEYWRITTENAREA) & (1 << keyStoreArea))) {
310  }
311 
312  // Enable keys to read (e.g. Key 0).
313  HWREG(CRYPTO_BASE + CRYPTO_O_KEYREADAREA) = keyStoreArea;
314 
315  // Wait until key is loaded to the AES module.
316  // We cannot simply poll the IRQ status as only an error is communicated through
317  // the IRQ status and not the completion of the transfer.
318  do {
319  CPUdelay(1);
320  }
321  while((HWREG(CRYPTO_BASE + CRYPTO_O_KEYREADAREA) & CRYPTO_KEYREADAREA_BUSY_M));
322 
323  // Check for keyStore read error.
324  if((HWREG(CRYPTO_BASE + CRYPTO_O_IRQSTAT) & CRYPTO_IRQSTAT_KEY_ST_RD_ERR_M)) {
325  return AES_KEYSTORE_ERROR;
326  }
327  else {
328  return AES_SUCCESS;
329  }
330 }
#define AES_KEY_AREA_7
Definition: aes.h:161
#define AES_SUCCESS
Definition: aes.h:119
#define AES_KEYSTORE_AREA_INVALID
Definition: aes.h:121
#define AES_KEY_AREA_5
Definition: aes.h:159
#define AES_KEYSTORE_ERROR
Definition: aes.h:120
#define AES_KEY_AREA_6
Definition: aes.h:160
#define AES_KEY_AREA_4
Definition: aes.h:158
#define AES_KEY_AREA_0
Definition: aes.h:154
#define ASSERT(expr)
Definition: debug.h:71
#define AES_KEY_AREA_1
Definition: aes.h:155
#define AES_KEY_AREA_3
Definition: aes.h:157
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:156
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().

338 {
339  // The intermediate array is used instead of a caller-provided one
340  // to enable a simple API with no unintuitive alignment or size requirements.
341  // This is a trade-off of stack-depth vs ease-of-use that came out on the
342  // ease-of-use side.
343  uint32_t computedTag[AES_BLOCK_SIZE / sizeof(uint32_t)];
344 
345  // Wait until the computed tag is ready.
346  while (!(HWREG(CRYPTO_BASE + CRYPTO_O_AESCTL) & CRYPTO_AESCTL_SAVED_CONTEXT_RDY_M));
347 
348  // Read computed tag out from the HW registers
349  // Need to read out all 128 bits in four reads to correctly clear CRYPTO_AESCTL_SAVED_CONTEXT_RDY flag
350  computedTag[0] = HWREG(CRYPTO_BASE + CRYPTO_O_AESTAGOUT0);
351  computedTag[1] = HWREG(CRYPTO_BASE + CRYPTO_O_AESTAGOUT1);
352  computedTag[2] = HWREG(CRYPTO_BASE + CRYPTO_O_AESTAGOUT2);
353  computedTag[3] = HWREG(CRYPTO_BASE + CRYPTO_O_AESTAGOUT3);
354 
355  memcpy(tag, computedTag, tagLength);
356 
357  return AES_SUCCESS;
358 }
#define AES_SUCCESS
Definition: aes.h:119
#define AES_BLOCK_SIZE
Definition: aes.h:134

§ AESReset()

void AESReset ( void  )

Reset the accelerator and cancel ongoing operations.

Precondition
AESDMAReset
Returns
None

Referenced by AESSetAuthLength().

525 {
526  /* Soft reset routine per SafeXcel */
527  HWREG(CRYPTO_BASE + CRYPTO_O_SWRESET) = CRYPTO_SWRESET_SW_RESET;
528  AESSetCtrl(0);
529  AESSetDataLength(0);
530  AESSetAuthLength(0);
531 
532  /* Only CC26X2, CC13X2, CC26X2F6, CC13X2F6, CC26X4, and CC13X4 devices have hash support */
533  HWREG(CRYPTO_BASE + CRYPTO_O_HASHMODE) = 0;
534  HWREG(CRYPTO_BASE + CRYPTO_O_HASHINLENL) = 0;
535  /* CRYPTO_O_HASHINLENH is automatically set to 0 by HW */
536 }
static void AESSetCtrl(uint32_t ctrlMask)
Set up the next crypto module operation.
Definition: aes.h:561
static void AESSetAuthLength(uint32_t length)
Specify the length of the additional authentication data (AAD).
Definition: aes.h:615
static void AESSetDataLength(uint32_t length)
Specify length of the crypto operation.
Definition: aes.h:588
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
540 {
541  ASSERT((algorithm == AES_ALGSEL_AES) ||
542  (algorithm == AES_ALGSEL_TAG) ||
543  (algorithm == AES_ALGSEL_KEY_STORE));
544 
545  HWREG(CRYPTO_BASE + CRYPTO_O_ALGSEL) = algorithm;
546 }
#define AES_ALGSEL_AES
Definition: aes.h:142
#define AES_ALGSEL_KEY_STORE
Definition: aes.h:143
#define ASSERT(expr)
Definition: debug.h:71
#define AES_ALGSEL_TAG
Definition: aes.h:144

§ 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().

616 {
617  HWREG(CRYPTO_BASE + CRYPTO_O_AESAUTHLEN) = length;
618 }
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().

562 {
563  HWREG(CRYPTO_BASE + CRYPTO_O_AESCTL) = ctrlMask;
564 }

§ 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().

589 {
590  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATALEN0) = length;
591  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATALEN1) = 0;
592 }

§ 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.
367 {
368  uint32_t resultStatus;
369  // The intermediate array is allocated on the stack to ensure users do not
370  // point the tag they provide and the one computed at the same location.
371  // That would cause memcmp to compare an array against itself. We could add
372  // a check that verifies that the arrays are not the same. If we did that and
373  // modified AESReadTag to just copy all 128 bits into a provided array,
374  // we could save 16 bytes of stack space while making the API much more
375  // complicated.
376  uint8_t computedTag[AES_BLOCK_SIZE];
377 
378  resultStatus = AESReadTag(computedTag, tagLength);
379 
380  if (resultStatus != AES_SUCCESS) {
381  return resultStatus;
382  }
383 
384  resultStatus = memcmp(computedTag, tag, tagLength);
385 
386  if (resultStatus != 0) {
388  }
389 
390  return AES_SUCCESS;
391 }
#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:337
#define AES_BLOCK_SIZE
Definition: aes.h:134
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
421 {
422  union {
423  uint32_t word[4];
424  uint8_t byte[16];
425  } initializationVector = {{0}};
426 
427  initializationVector.byte[0] = 15 - nonceLength - 1;
428 
429  memcpy(&(initializationVector.byte[1]), nonce, nonceLength);
430 
431  AESSetInitializationVector(initializationVector.word);
432 }
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().

475  {
476  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN0) = dataInBuffer[0];
477  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN1) = dataInBuffer[1];
478  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN2) = dataInBuffer[2];
479  HWREG(CRYPTO_BASE + CRYPTO_O_AESDATAIN3) = dataInBuffer[3];
480 }

§ 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().

439  {
440  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY20) = key2[0];
441  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY21) = key2[1];
442  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY22) = key2[2];
443  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY23) = key2[3];
444 }

§ 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().

451  {
452  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY30) = key3[0];
453  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY31) = key3[1];
454  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY32) = key3[2];
455  HWREG(CRYPTO_BASE + CRYPTO_O_AESKEY33) = key3[3];
456 }

§ 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. The keyStore can only contain valid keys of one aesKeyLength at any one point in time. The keyStore cannot contain both 128-bit and 256-bit keys simultaneously. When a key of a different aesKeyLength from the previous aesKeyLength is loaded, all previous keys are invalidated.

Parameters
[in]aesKeyPointer to key. Does not need to be word-aligned.
[in]aesKeyLengthThe key size in bytes. Currently, 128-bit, 192-bit, and 256-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. When using 256-bit or 192-bit keys, two consecutive key areas are used to store the key.
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  (aesKeyLength == AES_192_KEY_LENGTH_BYTES) ||
213  (aesKeyLength == AES_256_KEY_LENGTH_BYTES));
214 
215  // This buffer must be declared at function scope to prevent LLVM compiler from optimizing out memcpy.
216  uint8_t paddedKey[AES_256_KEY_LENGTH_BYTES] = {0};
217  uint32_t keySize = 0;
218 
219  switch (aesKeyLength) {
221  keySize = CRYPTO_KEYSIZE_SIZE_128_BIT;
222  break;
224  keySize = CRYPTO_KEYSIZE_SIZE_192_BIT;
225  break;
227  keySize = CRYPTO_KEYSIZE_SIZE_256_BIT;
228  break;
229  }
230 
231  // Clear any previously written key at the keyLocation
232  AESInvalidateKey(keyStoreArea);
233 
234  // Disable the external interrupt to stop the interrupt form propagating
235  // from the module to the System CPU.
236  IntDisable(INT_CRYPTO_RESULT_AVAIL_IRQ);
237 
238  // Enable internal interrupts.
239  HWREG(CRYPTO_BASE + CRYPTO_O_IRQTYPE) = CRYPTO_IRQTYPE_LEVEL_M;
240  HWREG(CRYPTO_BASE + CRYPTO_O_IRQEN) = CRYPTO_IRQEN_DMA_IN_DONE_M | CRYPTO_IRQEN_RESULT_AVAIL_M;
241 
242  // Configure master control module.
243  HWREG(CRYPTO_BASE + CRYPTO_O_ALGSEL) = CRYPTO_ALGSEL_KEY_STORE;
244 
245  // Clear any outstanding events.
246  HWREG(CRYPTO_BASE + CRYPTO_O_IRQCLR) = (CRYPTO_IRQCLR_DMA_IN_DONE | CRYPTO_IRQCLR_RESULT_AVAIL);
247 
248  // Configure the size of keys contained within the key store
249  // Do not write to the register if the correct key size is already set.
250  // Writing to this register causes all current keys to be invalidated.
251  uint32_t keyStoreKeySize = HWREG(CRYPTO_BASE + CRYPTO_O_KEYSIZE);
252  if (keySize != keyStoreKeySize) {
253  HWREG(CRYPTO_BASE + CRYPTO_O_KEYSIZE) = keySize;
254  }
255 
256  // Enable key to write (e.g. Key 0).
257  HWREG(CRYPTO_BASE + CRYPTO_O_KEYWRITEAREA) = 1 << keyStoreArea;
258 
259  if (aesKeyLength == AES_192_KEY_LENGTH_BYTES)
260  {
261  // Writing a 192-bit key to the key store RAM must be done by writing
262  // 256 bits of data with the 64 most significant bits set to zero.
263  memcpy(paddedKey, aesKey, AES_192_KEY_LENGTH_BYTES);
264 
266  }
267  else
268  {
269  // Total key length in bytes (16 for 1 x 128-bit key and 32 for 1 x 256-bit key).
270  AESStartDMAOperation(aesKey, aesKeyLength, 0, 0);
271  }
272 
273  // Wait for the DMA operation to complete.
274  uint32_t irqTrigger = AESWaitForIRQFlags(CRYPTO_IRQCLR_RESULT_AVAIL | CRYPTO_IRQCLR_DMA_IN_DONE | CRYPTO_IRQSTAT_DMA_BUS_ERR | CRYPTO_IRQSTAT_KEY_ST_WR_ERR);
275 
276  // Re-enable interrupts globally.
277  IntPendClear(INT_CRYPTO_RESULT_AVAIL_IRQ);
278  IntEnable(INT_CRYPTO_RESULT_AVAIL_IRQ);
279 
280  // If we had a bus error or the key is not in the CRYPTO_O_KEYWRITTENAREA, return an error.
281  if ((irqTrigger & (CRYPTO_IRQSTAT_DMA_BUS_ERR_M | CRYPTO_IRQSTAT_KEY_ST_WR_ERR_M)) || !(HWREG(CRYPTO_BASE + CRYPTO_O_KEYWRITTENAREA) & (1 << keyStoreArea))) {
282  // There was an error in writing to the keyStore.
283  return AES_KEYSTORE_ERROR;
284  }
285  else {
286  return AES_SUCCESS;
287  }
288 }
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:161
#define AES_SUCCESS
Definition: aes.h:119
#define AES_KEY_AREA_5
Definition: aes.h:159
#define AES_KEYSTORE_ERROR
Definition: aes.h:120
#define AES_KEY_AREA_6
Definition: aes.h:160
#define AES_KEY_AREA_4
Definition: aes.h:158
#define AES_KEY_AREA_0
Definition: aes.h:154
#define ASSERT(expr)
Definition: debug.h:71
static void AESInvalidateKey(uint32_t keyStoreArea)
Invalidate a key in the key store.
Definition: aes.h:510
#define AES_KEY_AREA_1
Definition: aes.h:155
#define AES_128_KEY_LENGTH_BYTES
Definition: aes.h:130
#define AES_KEY_AREA_3
Definition: aes.h:157
#define AES_192_KEY_LENGTH_BYTES
Definition: aes.h:131
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_256_KEY_LENGTH_BYTES
Definition: aes.h:132
#define AES_KEY_AREA_2
Definition: aes.h:156
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_192_KEY_LENGTH_BYTES

#define AES_192_KEY_LENGTH_BYTES   (192 / 8)

Referenced by AESWriteToKeyStore().

§ AES_256_KEY_LENGTH_BYTES

#define AES_256_KEY_LENGTH_BYTES   (256 / 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().