GD32W51x User Manual
931
Figure 27-6. DES/TDES CBC encryption
SWAP
CAU_DI
DATAM
DEA, encrypt
DEA, encrypt
DEA, decrypt
KEY1
KEY2
KEY3
SWAP
CAU_DO
Plaintext
Ciphertext
+
CAU_IV0(H/L)
DES/TDES CBC decryption
In DES/TDES CBC decryption, when the TDES algorithm is configured, the first ciphertext
block is used directly after data swapping according to the data type, it is read in the DEA and
decrypted using KEY3. The output is fed back directly to next DEA and t hen encrypted using
KEY2. After that, the output is fed back directly to the last DEA and decrypted with KEY1. The
first result of above process is then XORed with the initialization vector which is the same as
that used during encryption. At the same time, the first ciphertext is then used as the next
initialization vector and exclusive-ORed with the next result after DEA blocks. 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. When the DES
algorithm is configured, the state and process of the second and third block of DEA should
also be omitted. The procedure of DES/TDES CBC mode decryption is illustrated in
.