
GD32L23x User Manual
569
Figure 23-10. AES CBC encryption
SWAP
CAU_DI
DATAM
AEA, encrypt
CAU_KEY0..3
SWAP
CAU_DO
Plaintext
Ciphertext
+
CAU_IV0..1(H/L)
AES-CBC mode decryption
Similar to that in AES-ECB mode decryption, the key derivation also must be completed first
to prepare the decryption keys, the input of the key schedule should be the same to that used
in encryption. The last round key obtained from the above operation is then used as the first
round key in the decryption. After the key derivation, the 128-bit input ciphertext is first
obtained after data swapping according to the data type. The input data block is read in the
AEA and decrypted using keys prepared above. At the same time, the first ciphertext is then
used as the next initialization vector and exclusive-ORed with the next result after AEA blocks
(The first initialization is obtained directly from the CAU_IV0..1 registers). The above
operations are repeated until the last ciphertext block is decrypted. Note if the ciphertext
message does not consist of an integral number of data blocks, the final partial data block
should be decrypted in a specified manner same to that in encryption. At last, the output
plaintext is also obtained after data swapping according to the data type. The procedure of
AES CBC mode decryption is illustrated in