SLAU846A June 2023 – October 2023 MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G3105 , MSPM0G3105-Q1 , MSPM0G3106 , MSPM0G3106-Q1 , MSPM0G3107 , MSPM0G3107-Q1 , MSPM0G3505 , MSPM0G3505-Q1 , MSPM0G3506 , MSPM0G3506-Q1 , MSPM0G3507 , MSPM0G3507-Q1
The AES accelerator is configured with user software, and has two general modes of operation (configured with the AESACTL0 register):
Regardless of single block mode or block cipher mode, the key length and operation type are specified by the KL and OP fields in the AESACTL0 register. The KLx and OPx fields are not reset by the AES software reset control (the SWRST bit in the AESACTL0 register). Whenever the KLx or OPx fields are changed, the key memory is reset.
The KLx and OPx combination determines the cycle count per block operation, as shown in Table 23-2.
AESOPx | AESKLx | Operation | Clock Cycles |
---|---|---|---|
00 | 00 | AES128 encryption | 168 |
10 | AES256 encryption | 234 | |
01 | 00 | AES128 decryption | 215 |
10 | AES256 decryption | 292 | |
10 | 00 | AES128 encryption key schedule is performed (to generate last roundkey) | 53 |
10 | AES256 encryption key schedule is performed (to generate last roundkey) | 68 | |
11 | 00 | AES128 decryption (with last roundkey) is performed | 168 |
10 | AES256 decryption (with last roundkey) is performed | 234 |
Internally, the AES algorithm’s operations are performed on a two-dimensional array of bytes called the STATE. The STATE consists of four rows of bytes, each containing four bytes, independent of whether AES128 or AES256 is performed. The input is assigned to the STATE array as shown in Figure 23-2, with in[0] being the first data byte written into one of the AES accelerators input registers (AESADIN, AESAXDIN, and AESXIN). The encrypt or decrypt operations are then conducted on the STATE array, after which its final values can be read from the output with out[0] being the first data byte read from the AES accelerator data output register (AESADOUT).
If an encryption is to be performed, the initial state is called plaintext. If a decryption is to be performed, the initial state is called ciphertext.