From c8e0e23660a53c16a0696e95eed8bb77fb0437e1 Mon Sep 17 00:00:00 2001 From: Jeremiah Mackey Date: Thu, 26 Mar 2026 16:35:54 +0000 Subject: [PATCH] use constant-time tag compare in TI AES --- wolfcrypt/src/port/ti/ti-aes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/port/ti/ti-aes.c b/wolfcrypt/src/port/ti/ti-aes.c index 738e380619..2dfe358087 100644 --- a/wolfcrypt/src/port/ti/ti-aes.c +++ b/wolfcrypt/src/port/ti/ti-aes.c @@ -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; }