I'm currently playing around with the TI provided example programs. When using AES-GCM-256, I encountered a possible issue within the example projects:
aes_gcm_encrypt
aes_gcm_decrypt
When using public test vectors the AES-GCM-256 procedure will fail. This is caused by a parameter given in the following call, which is part of AESGCMY0Get():
//
// Next, perform the GHASH operation.
//
AESGHASH(ui32Keysize, pui32HashSubkey, pui32IV, ui32IVLength, pui32Y0);
According to my research the subkey H always has a length of 128 bits, while here it might become 192 bits or 256 bits (in case of AES-GCM-256). So in my opinion the call should be changed into:
AESGHASH(AES_CFG_KEY_SIZE_128BIT, pui32HashSubkey, pui32IV, ui32IVLength, pui32Y0);
Using this modification the example projects will pass all public test vectors.
Could you please verify this potential issue?