2025-02-11 09:15 PM
Hi,
I am trying to use the AES hardware on the STM32U545 with the STM HAL libraries.
I am able to correctly encrypt and tag an number of bytes of plain text. However, whenever I try to decrypt an encrypted message with a length not divisible by 4 I get a tag mismatch but the decrypted plain text is correct.
I am using byte size data width for everything and have no header data.
From what I can see is that the encryption will work for any arbitrary size, however, the decryption tag is not computed correctly, unless the size is divisible by 4. Is this expected behavior or is this an issue with the HAL?
Thanks!