The following list describes the requirements for initializing the AES and associated modules.
- Configure the AES µDMA channels for Context In, Context Out, Data In, and Data Out by programming the appropriate encoding value in the DMA Channel Map Select n (DMA_CHMAPn) register in the µDMA module. For more information, refer to the Micro Direct Memory Access (μDMA) chapter.
- 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 (DTHE_AES_IM) register.
- Specify the size of the keys by programming the KEY_SIZE bit field in the AES_CTRL register.
- Load the AES Key 1 (AES_KEY1_n) register.
- Load the AES Key 2 (AES_KEY2_n) register if it is used by the configuration mode.
- Configure the AES for the appropriate encryption or decryption mode (see Section 42.4.1.2).
- Select encryption or decryption by programming the DIRECTION bit in the AES Control (AES_CTRL) register.