943
SAM4CP [DATASHEET]
43051E–ATPL–08/14
To have a sequential increment, the counter value must be programmed with the value programmed for the previous
fragment + 2
16
(or less for the first fragment).
All AES_IVRx fields must be programmed to take into account the possible carry propagation.
41.4.2 Double Input Buffer
The AES_IDATARx can be double-buffered to reduce the runtime of large files.
This mode allows writing a new message block when the previous message block is being processed. This is only
possible when DMA accesses are performed (SMOD = 0x2).
The DUALBUFF bit in AES_MR must be set to 1 to access the double buffer.
41.4.3 Start Modes
The SMOD field in the AES_MR allows selection of the encryption (or decryption) start mode.
41.4.3.1 Manual Mode
The sequence order is as follows:
Write the AES_MR with all required fields, including but not limited to SMOD and OPMOD.
Write the 128-bit/192-bit/256-bit key in the AES_KEYWRx.
Write the initialization vector (or counter) in the AES_IVRx.
Note:
The AES_IVRx concern all modes except ECB.
Set the bit DATRDY (Data Ready) in the AES Interrupt Enable register (AES_IER), depending on whether an
interrupt is required or not at the end of processing.
Write the data to be encrypted/decrypted in the authorized AES_IDATARx (See
Table 41-2
).
Notes: 1.
In 64-bit CFB mode, writing to AES_IDATAR2 and AES_IDATAR3 is not allowed and may lead to errors in
processing.
In 32-, 16- and 8-bit CFB modes, writing to AES_IDATAR1, AES_IDATAR2 and AES_IDATAR3 is not
allowed and may lead to errors in processing.
2.
Set the START bit in the AES Control register (AES_CR) to begin the encryption or the decryption process.
When processing completes, the DATRDY flag in the AES Interrupt Status Register (AES_ISR) is raised. If an
interrupt has been enabled by setting the DATRDY bit in the AES_IER, the interrupt line of the AES is activated.
When software reads one of the AES_ODATARx, the DATRDY bit is automatically cleared.
Table 41-2.
Authorized Input Data Registers
Operation Mode
Input Data Registers to Write
ECB
All
CBC
All
OFB
All
128-bit CFB
64-bit CFB
(1)
32-bit CFB
(2)
16-bit CFB
(2)
8-bit CFB
(2)
All
AES_IDATAR0 and AES_IDATAR1
AES_IDATAR0
AES_IDATAR0
AES_IDATAR0
CTR
All
GCM
All