DocID018909 Rev 11
721/1731
RM0090
Cryptographic processor (CRYP)
757
Figure 223. AES-ECB mode decryption
1. K: key; C: cipher text; I: input block; O: output block; P: plain text.
2. If Key size = 128 => Key = [K3 K2].
If Key size = 192 => Key = [K3 K2 K1]
If Key size = 256 => Key = [K3 K2 K1 K0].
AES Cipher block chaining (AES-CBC) mode
•
AES-CBC mode encryption
The AES Cipher block chaining (AES-CBC) mode decryption is shown on
.
In AES-CBC encryption, the first input block (I
1
) obtained after bit/byte/half-word
swapping (refer to
Section 23.3.3: Data type on page 730
) is formed by exclusive-
ORing the first plaintext data block (P
1
) with a 128-bit initialization vector IV (I
1
= IV
⊕
P
1
). The input block is processed through the AEA in the encrypt state using the 128-,
192- or 256-bit key (K0...K3). The resultant 128-bit output block (O
1
) is used directly as
ciphertext (C
1
), that is, C
1
= O
1
. This first ciphertext block is then exclusive-ORed with
the second plaintext data block to produce the second input block, (I
2
) = (C
1
⊕
P
2
). Note
that I
2
and P
2
now refer to the second block. The second input block is processed
through the AEA to produce the second ciphertext block. This encryption process
continues to “chain” successive cipher and plaintext blocks together until the last
plaintext block in the message is encrypted. If the message does not consist of an
integral number of data blocks, then the final partial data block should be encrypted in a
manner specified for the application.
In the CBC mode, like in the ECB mode, the secret key must be prepared to perform an
AES decryption. Refer to
Section 23.3.6: Procedure to perform an encryption or a
for more details on how to prepare the key.
•
AES-CBC mode decryption
In AES-CBC decryption (see
), the first 128-bit ciphertext block (C
1
) is used
directly as the input block (I
1
). The input block is processed through the AEA in the
decrypt state using the 128-, 192- or 256-bit key. The resulting output block is
exclusive-ORed with the 128-bit initialization vector IV (which must be the same as that
used during encryption) to produce the first plaintext block (P
1
= O
1
⊕
IV). The second
ciphertext block is then used as the next input block and is processed through the AEA.
The resulting output block is exclusive-ORed with the first ciphertext block to produce
the second plaintext data block (P
2
= O
2
⊕
C
1
). (Note that P
2
and O
2
refer to the second
).&)&/
#BITS
/54&)&/
CIPHERTEXT#
PLAINTEXT0
!%!DECRYPT
)BITS
SWAPPING
/BITS
$!4!490%
$!4!490%
0BITS
SWAPPING
+
OR
-36