944
SAM4CP [DATASHEET]
43051E–ATPL–08/14
41.4.3.2 Auto Mode
The Auto Mode is similar to the manual one, except that in this mode, as soon as the correct number of AES_IDATARx is
written, processing is automatically started without any action in the AES_CR.
41.4.3.3 PDC Mode
The Peripheral DMA Controller (PDC) can be used in association with the AES to perform an encryption/decryption of
a buffer without any action by software during processing.
The field SMOD in the AES_MR must be configured to 0x2.
The sequence order is as follows:
Write the AES_MR with all required fields, including but not limited to SMOD and OPMOD.
Write the 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 Transmit Pointer Register (AES_TPR) to the address where the data buffer to encrypt/decrypt is stored
and the Receive Pointer Register (AES_RPR) where it must be encrypted/decrypted.
Note:
Transmit and receive buffers can be identical.
Set the Transmit and the Receive Counter Registers (AES_TCR and AES_RCR) to the same value. This value
must be a multiple of the data transfer type size (see
Table 41-3 "Data Transfer Type for the Different Operation
Modes"
).
Note:
The same requirements are necessary for the Next Pointer(s) and Counter(s) of the PDC (AES_TNPR,
AES_RNPR, AES_TNCR, AES_RNCR).
If not already done, set the bit ENDRX (or RXBUFF if the next pointers and counters are used) in the AES_IER,
depending on whether an interrupt is required or not at the end of processing.
Enable the PDC in transmission and reception to start the processing (AES_PTCR).
When the processing completes, the ENDRX (or RXBUFF) flag in the AES_ISR is raised. If an interrupt has been
enabled by setting the corresponding bit in the AES_IER, the interrupt line of the AES is activated.
When PDC is used, the data size to transfer (byte, half-word or word) depends on the AES mode of operations. This size
is automatically configured by the AES.
Table 41-3.
Data Transfer Type for the Different Operation Modes
Operation Mode
Data Transfer Type
ECB
Word
CBC
Word
OFB
Word
CFB 128-bit
Word
CFB 64-bit
Word
CFB 32-bit
Word
CFB 16-bit
Half-word
CFB 8-bit
Byte
CTR
Word
GCM
Word