AES Module Programming Guide
674
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
Advance Encryption Standard Accelerator (AES)
9.4
AES Module Programming Guide
9.4.1 AES Low - Level Programming Models
This section describes the low-level hardware programming sequences for configuring and using the AES
module.
9.4.1.1
Global Initialization
The following list describes the requirements for initializing the AES and surrounding modules when the
AES is used for the first time after a device reset.
1. When reset has completed, enable the AES by setting the R0 bit in the CRC and Cryptographic
Modules Run Mode Clock Gating Control (RCGCCCM), System Control offset 0x674. When the R0 bit
is set in the CRC and Cryptographic Modules Peripheral Ready (PRCCM), System Control offset
0xA74 register, the AES is powered and ready to be configured.
2. Configure the AES µDMA channels for Context In, Context Out, Data In, and/or Data Out by
programming the appropriate encoding value in the DMA Channel Map Select n (DMACHMAPn)
register in the µDMA module, offset 0x510. For more information on how to program channel
assignments as well as enabling burst and the configured channels, refer to
3. Execute a software reset by setting the SOFTRESET bit in the AES_SYSCONFIG register. When reset
is complete, the RESETDONE bit reads as 1 in the AES_SYSSTATUS register.
4. If the AES channels are configured in the µDMA, enable the required AES DMA requests by
programming bits [9:5] of the AES_SYSCONFIG register, in addition to the completion interrupts in the
AES DMA Interrupt Mask (AES_DMAIM) register, CCM offset 0x020.
5. Specify the size of the keys by programming the KEY_SIZE bit field in the AES_CTRL register.
6. Load AES Key 1 (AES_KEY1_n) register.
7. Load AES Key 2 (AES_KEY2_n) register if it is used by the configuration mode. See
for
information regarding which configuration modes require a load to this register.
8. Configure the AES for the appropriate encryption or decryption mode (see
to
9. Select encryption or decryption by programming the DIRECTION bit in the AES Control (AES_CTRL)
register, offset 0x050.
9.4.1.2
Initialization Subsequence
The following sections list the initialization subsequences for the available encryption or decryption modes:
9.4.1.2.1 Subsequence: Initialize CCM AES Core Mode
The CCM mode initialization is as follows:
1. Define the width of the length field and the length of the authentication field by programming the
CCM_L and CCM_M bit fields in the AES_CTRL register at offset 0x050.
2. Enable counter mode by setting the CTR bit in the AES_CTRL register.
3. Load the authentication data length in the AUTH field of the AES Authentication Data Length
(AES_AUTH_LENGTH) register at offset 0x05C.
4. Select the IV counter by programming the CTR_WIDTH field in the AES_CTRL register.
5. Load the AES Initialization Vector Input n (AES_IV_IN_n) registers at offset 0x040 to 0x04C.
9.4.1.2.2 Subsequence: Initialize GCM AES Core Mode
The following steps to enable GCM mode is as follows:
1. Enable counter mode by setting the CTR bit in the AES_CTRL register.
2. Load the authentication data length in the AUTH field of the AES Authentication Data Length
(AES_AUTH_LENGTH) register at offset 0x05C.
3. Select the IV counter by programming the CTR_WIDTH field in the AES_CTRL register.