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.
This commit is contained in:
Shreesh Adiga
2026-07-10 18:27:46 +05:30
committed by Martin Storsjö
parent a09be9b91e
commit 7b9eeadda0

View File

@@ -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();