2025-05-22 12:44 AM
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
2025-05-22 4:05 AM
The code appears to be doing the padding here. Does it not?
2025-05-22 4:40 AM
Yes, it does, but the corresponding code in STM32H7RSxx library is not working.
Assuming hcryp->Init.HeaderSize = 4 (bytes), the code will input 16 bytes to CRYP module.