Ciphertext
Plaintext
AES128/192/256
decrypt
Key
Ciphertext
Plaintext
AES128/192/256
decrypt
Key
Ciphertext
Plaintext
AES128/192/256
decrypt
Key
A
B
AES Accelerator Operation
409
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
AES256 Accelerator
14.2.11.1.2 ECB Decryption
Figure 14-7. ECB Decryption
To implement the ECB decryption without CPU interaction, two DMA channels are needed. Static DMA
priorities must be enabled. The DMA triggers must be configured as level-sensitive triggers.
Table 14-4. AES DMA Configuration for ECB Decryption
AES
CMEN
AES
CMx
AES
OPx
DMA_A
Triggered by 'AES trigger 0'
DMA_B
Triggered by 'AES trigger 1'
1
00
01 or 11
Read plaintext from AESADOUT
Write ciphertext to AESADIN, which also
triggers the next decryption
The following pseudo code snippet shows the implementation of the ECB decryption in software:
ECB_Decryption(key, plaintext, ciphertext, num_blocks)
// Pseudo Code
{
Generate Decrypt Key
Configure AES:
AESCMEN= 0; AESOPx= 10;
Write key into AESAKEY;
Wait until key generation completed.
Configure AES for block cipher:
AESCMEN= 1; AESCMx= ECB; AESOPx= 11;
AESKEYWR= 1; // Use previously generated key
Setup DMA:
DMA0: Triggered by AES trigger 0,
Source: AESADOUT, Destination: plaintext,
Size: num_blocks*8 words, Single Transfer mode
DMA1: Triggered by AES trigger 1,
Source: ciphertext, Destination: AESADIN,
Size: num_blocks*8 words, Single Transfer mode
Start decryption:
AESBLKCNT= num_blocks;
End of decryption: DMA0IFG=1
}