GD32W51x User Manual
935
plaintext is also obtained after data swapping according to the data type. The procedure of
AES CBC mode decryption is illustrated in
Figure 27-11. AES CBC decryption
.
Figure 27-11. AES CBC decryption
SWAP
CAU_DI
DATAM
AEA, decrypt
CAU_KEY0..3
SWAP
CAU_DO
Ciphertext
Plaintext
CAU_IV0..1(H/L)
+
AES-CTR mode
In counter mode, a counter is used in addition with a nonce value to be encrypted and
decrypted in AEA, and the result will be used for the XOR operation with the plaintext or the
ciphertext. As the counter is incremented from the same initialized value for each block in
encryption and decryption, the key schedules during the encryption and decryption are the
same. Then decryption operation acts exactly in the same way as the encryption operation.
Only the 32-bit LSB of the 128-bit initialization vector represents the counter, which means
the other 96 bits are unchanged during the operation, and the initial value should be set to 1.
Nonce is 32-bit single-use random value and should be updated to each communication block.
And the 64-bit initialization vector is used to ensure that a given value is used only once for a
given key.
Figure 27-12. Counter block structure
illustrates the counter block structure and
Figure 27-13. AES CTR encryption/decryption
shows the AES CTR encryption/decryption.
Figure 27-12. Counter block structure
NONCE
Initialization
vector
Counter