use constant-time tag compare in TI AES

This commit is contained in:
Jeremiah Mackey
2026-03-26 16:35:54 +00:00
parent f382526bcc
commit c8e0e23660
+2 -2
View File
@@ -592,7 +592,7 @@ static int AesAuthDecrypt(Aes* aes, byte* out, const byte* in, word32 inSz,
ROM_AESDataProcess(AES_BASE, aes->reg, tmpTag, WC_AES_BLOCK_SIZE);
wolfSSL_TI_unlockCCM();
if (XMEMCMP(authTag, tmpTag, authTagSz) != 0) {
if (ConstantCompare(authTag, tmpTag, authTagSz) != 0) {
ret = AES_GCM_AUTH_E;
}
return ret;
@@ -645,7 +645,7 @@ static int AesAuthDecrypt(Aes* aes, byte* out, const byte* in, word32 inSz,
(unsigned int*)tmpTag);
wolfSSL_TI_unlockCCM();
if ((ret == false) || (XMEMCMP(authTag, tmpTag, authTagSz) != 0)) {
if ((ret == false) || (ConstantCompare(authTag, tmpTag, authTagSz) != 0)) {
XMEMSET(out, 0, inSz);
ret = AES_GCM_AUTH_E;
}