AES Accelerator Operation
401
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
AES256 Accelerator
NOTE:
General Access Restrictions
While the AES accelerator is busy (AESBUSY = 1):
•
AESADOUT always reads as zero.
•
The AESDOUTCNTx counter, the AESDOUTRD flag, and the AESDINWR flag are
reset.
•
Any attempt to change AESOPx, AESKLx, AESDINWR, or AESKEYWR is ignored.
•
Writing to AESAKEY, AESADIN, AESAXDIN, or AESAXIN aborts the current operation,
the complete module is reset (except for the AESRDYIE, AESOPx, and AESKLx), and
the AES error flag AESERRFG is set.
AESADIN, AESAXDIN, AESAXIN, and AESAKEY are write-only registers and always read
as zero.
Writing data into AESADIN, AESAXDIN, or AESAXIN influences the content of the
corresponding output data; for example, writing in[0] alters out[0], writing in[1] alters out[1],
and so on. However, interleaved operation is possible; for example, first reading out[0] and
then writing in[0], and continuing with reading out[1] and then writing in[1], and so on. This
interleaved operation must be either byte or word access on in[x] and out[x].
Access Restriction With Cipher Modes Enabled (AESCMEN = 1)
When cipher modes are enabled (AESCMEN = 1) and a cipher block operation is being
processed (AESBLKCNTx > 0), writes to the following bits are ignored, independent of
AESBUSY: AESCMEN, AESCMx, AESKLx, AESOPx, and AESBLKCNTx. Writing to
AESAKEY aborts the cipher block mode operation if AESBUSY = 1, and the complete
module is reset (except for AESRDYIE, AESOPx, and AESKLx).
14.2.1 Load the Key (128-Bit, 192-Bit, or 256-Bit Key Length)
The key can be loaded by writing to the AESAKEY register or by setting AESKEYWR. Depending on the
selected key length (AESKLx), a different number of bits must be loaded:
•
If AESKLx = 00, the 128-bit key must be loaded using either 16 byte-writes or 8 word-writes to
AESAKEY.
•
If AESKLx = 01, the 192-bit key must be loaded using either 24 byte-writes or 12 word-writes to
AESAKEY.
•
If AESKLx = 10, the 256-bit key must be loaded using either 32 byte-writes or 16 word-writes to
AESAKEY.
The key memory is reset after changing the AESKLx.
If a key was loaded previously without changing AESOPx, the AESKEYWR flag is cleared with the first
write access to AESAKEY.
If the conversion is triggered without writing a new key, the last key is used. The key must always be
written before writing the data.
14.2.2 Load the Data (128-Bit State)
The state can be loaded by writing to AESADIN, AESAXDIN, or AESAXIN with 16 byte writes or 8 word
writes. Do not mix byte and word mode when writing the state. Writing to a mixture of AESADIN,
AESAXDIN, and AESAXIN using the same byte or word data format is allowed. When the 16th byte or 8th
word of the state is written, AESDINWR is set.
When writing to AESADIN, the corresponding byte or word of the state is overwritten. If AESADIN is used
to write the last byte or word of the state, encryption or decryption starts automatically.
When writing to AESAXDIN, the corresponding byte or word is XORed with the current byte or word of the
state. If AESAXDIN is used to write the last byte or word of the state, encryption or decryption starts
automatically.