Skip to main content
Explorer II
November 27, 2023
Question

[STM32H753] CRYP FIFOs flush for AES

  • November 27, 2023
  • 1 reply
  • 944 views

Hello,

According to the Reference Manual v8 of STM32H753 one has to to flush the FIFO to perform a cipher operation:

 

Gpeti_0-1701083358772.png

 

The STM32Cube source code example is not doing this flush for AES-GCM (it does the flush for DES and TDES)

I implemented my code like the example and it seems to work fine.

 

1) is the flush needed or not for AES ?

2) why flushing the fifo in the nominal case anyway?

 

Best regards

 

 

    This topic has been closed for replies.

    1 reply

    ST Employee
    November 29, 2023

    Hello @Gpeti 

    The reason for this is that the AES-GCM algorithm uses the same key and IV for both encryption and decryption, and the input and output data are processed in blocks of 16 bytes. Therefore, the input and output FIFOs are not expected to contain any residual data from a previous operation.

    However, it is still a good practice to perform the flush operation to ensure that the input and output FIFOs are cleared before starting a new operation. This can prevent any potential issues that may arise from residual data in the FIFOs especially with older algorithms like DES and TDES.

    BR