To perform decryption:
- Set OPx = 0x1 to select decryption using the same key used for encryption, or set OPx = 0x3 if the first round key required for decryption (the last round key used for encryption) is already pregenerated and will be loaded in step 2. Changing the OPx bits clears the KEYWR flag, and a new key must be loaded in step 2.
- Load the key according to Section 23.2.2.
- Load the STATE (data) according to Section 23.2.3. After the data is loaded, the AES module starts the decryption.
- Wait for the operation to complete (wait for the BUSY flag to clear).
- After the decryption is ready, the result can be read from AESADOUT as described in Section 23.2.4.
- If additional data should be decrypted with the same key loaded in step 2, new data can be written into AESADIN after the results of the operation on the previous data were read from
AESADOUT. When additional 16 data bytes are written, the module automatically starts the decryption using the key loaded in step 2.
The decryption process with decryption round key generation is given in Figure 23-4 (128-bit key with 10 rounds shown).