56.4.4.2.2 TDES_MR.LOD = 1

This mode is optimized to process the TDES CBC-MAC operating mode.

The user must first wait for the DMA buffer transfer complete flag, then for the flag DATRDY to rise to ensure that the encryption/decryption is completed (see the figure below).

The DMA receive channel must not be used. Prior to reading the CBC-MAC result, TDES_MR.SMOD must be written to 0. To restart a CBC-MAC on a new buffer, TDES_MR.SMOD must be written to 2.

The output data is only available on TDES_ODATARx.

Figure 56-5. DMA Transfer with LOD = 1

The table below summarizes the different cases.

Table 56-4. Last Output Data Mode Behavior versus Start Modes
Sequence Manual and Auto Modes DMA Transfer
LOD = 0 LOD = 1 LOD = 0 LOD = 1
DATRDY Flag Clearing Condition(1) At least one TDES_ODATARx must be read At least one TDES_IDATARx must be written Not used Managed by the DMA
End of Encryption/Decryption DATRDY DATRDY 2 DMA buffer transfer complete flags (channel m and channel n) DMA buffer transfer complete flag, then TDES DATRDY flag
Encrypted/Decrypted Data Result Location In TDES_ODATARx In TDES_ODATARx Not available In TDES_ODATARx
Note: Depending on the mode, there are other ways of clearing the DATRDY flag. See TDES Interrupt Status Register.
Warning: In DMA mode, reading to TDES_ODATARx before the last data transfer may lead to unpredictable results.