From 7b9eeadda06edd6ef7f604d5c3863f30722c7c15 Mon Sep 17 00:00:00 2001 From: Shreesh Adiga <16567adigashreesh@gmail.com> Date: Fri, 10 Jul 2026 18:27:46 +0530 Subject: [PATCH] tests/checkasm/aes: fix memcmp size argument sizeof(16 * count) evaluates to 4 and thus only the first 4 bytes of aes output was being compared. Removing the sizeof operator will ensure that the whole output buffer will be compared. --- tests/checkasm/aes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/checkasm/aes.c b/tests/checkasm/aes.c index c5502118fa..4bbfc5750b 100644 --- a/tests/checkasm/aes.c +++ b/tests/checkasm/aes.c @@ -46,13 +46,13 @@ void checkasm_check_aes(void) iv[0][j] = iv[1][j] = rnd(); call_ref(&b, temp[0], pt, count, iv[0], b.rounds); call_new(&b, temp[1], pt, count, iv[1], b.rounds); - if (memcmp(temp[0], temp[1], sizeof(16 * count))) + if (memcmp(temp[0], temp[1], 16 * count)) fail(); if (memcmp(iv[0], iv[1], sizeof(iv[0]))) fail(); call_ref(&b, temp[0], pt, count, NULL, b.rounds); call_new(&b, temp[1], pt, count, NULL, b.rounds); - if (memcmp(temp[0], temp[1], sizeof(16 * count))) + if (memcmp(temp[0], temp[1], 16 * count)) fail(); if (memcmp(iv[0], iv[1], sizeof(iv[0]))) fail();