From 8a7e3ba52e9ace85ba2f2ccd53c3d497efd6260b Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Thu, 23 May 2024 15:12:10 +0800 Subject: [PATCH] Simplify CMAC verification logic --- wolfcrypt/src/cmac.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/wolfcrypt/src/cmac.c b/wolfcrypt/src/cmac.c index 460d02a078..88daecfa55 100644 --- a/wolfcrypt/src/cmac.c +++ b/wolfcrypt/src/cmac.c @@ -449,10 +449,8 @@ int wc_AesCmacVerify_ex(Cmac* cmac, devId); if (ret == 0) { compareRet = ConstantCompare(check, a, (int)min(checkSz, aSz)); - } - - if (ret == 0) ret = compareRet ? 1 : 0; + } return ret; }