
GD32L23x User Manual
568
Figure 23-9. AES ECB decryption
SWAP
CAU_DI
DATAM
AEA, decrypt
CAU_KEY0..3
SWAP
CAU_DO
Ciphertext
Plaintext
AES-CBC mode encryption
The input data of the AEA block in CBC mode consists of two aspects: the input plaintext after
data swapping according to the data type, and the initialization vectors. The XOR result of the
swapped plaintext data block and the 128-bit initialization vector CAU_IV0..1 is read in the
AEA and encrypted using the 128-, 192-, 256-bit key. The result is then used as the next
initialization vector and exclusive-ORed with the next plaintext data block to process next
encryption. The above operations are repeated until the last plaintext block is encrypted. Note
if the plaintext message does not consist of an integral number of data blocks, the final partial
data block should be encrypted in a specified manner. At last, the output ciphertext is also
obtained after data swapping according to the data type. The procedure of AES CBC mode
encryption is illustrated in