Skip to main content
alessandro.breuza
Associate III
May 22, 2025
Question

buggy STM32H7S CRYP HAL

  • May 22, 2025
  • 1 reply
  • 432 views

Hello,

HAL driver for CRYP peripheral of STM32H7RSxx series generates invalid AES GCM TAG.

According specs, header should be 0-padded to 16 bytes, but in the function CRYP_GCMCCM_SetHeaderPhase() the HeaderSize field is assumed to be expressed in words.

This leads to errors when header is, for example, 5 bytes long (as in TLS handshake).

 

cfr. STM32H7xx series implementation

 

STM32Cube FW_H7RS V1.2.0

 

Alessandro

1 reply

TDK
Super User
May 22, 2025
"If you feel a post has answered your question, please click ""Accept as Solution""."
alessandro.breuza
Associate III
May 22, 2025

Yes, it does, but the corresponding code in STM32H7RSxx library is not working.

https://github.com/STMicroelectronics/stm32h7rsxx-hal-driver/blob/68e6cb59339fec2b0dd1c90f1492c39d18e69af7/Src/stm32h7rsxx_hal_cryp.c#L6925

 

Assuming hcryp->Init.HeaderSize = 4 (bytes), the code will input 16 bytes to CRYP module.