cancel
Showing results for 
Search instead for 
Did you mean: 

AES GCM STM32U545

AK2
Visitor

Post edited by ST moderator to be inline with the community rules especially with the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code

Hello,
I am trying to use AES GCM on the STM32U545.
When I verify the result, I use the site "AES Encryption Online - Ciphereditor". In the vector, I have to input the value without the counter (0x02); otherwise, the results don't match.
Why is this happening?

Here are my test vectors:

Data: 02 03 04 05 06 07 08 09
Key: 59 9e b6 5e 6b 2a 2a 7f cc 40 e5 1c 4f 6e 32 57
IV: d4 07 30 1c fa 29 af 85 25 98 1c 17 00 00 00 02
AAD: 29 0A 0B 0C

Configuration:

aesGcmDesc.KeySize = CRYP_KEYSIZE_128B;
aesGcmDesc.DataType = CRYP_NO_SWAP;
aesGcmDesc.Algorithm = CRYP_AES_GCM_GMAC;
aesGcmDesc.pKey = (uint32_t*)v->key;
aesGcmDesc.pInitVect = (uint32_t*)v->iv;
aesGcmDesc.pAAD = (uint32_t*)v->aad;
aesGcmDesc.AADSize = 4;
aesGcmDesc.TagSize = 16;
aesGcmDesc.Timeout = 0xFF;

 

0 REPLIES 0