X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/e74ca64c0ec65a93d2f133c4472256e3bbb688e2..141c12847a1c2f8cc8db03d420551584e689fb87:/symm/sha3.c diff --git a/symm/sha3.c b/symm/sha3.c index 16967629..36bd430b 100644 --- a/symm/sha3.c +++ b/symm/sha3.c @@ -957,6 +957,7 @@ grand *kmac256_rand(const void *perso, size_t psz, const void *k, size_t sz) #include +#include #include #include @@ -979,7 +980,7 @@ static int vrf_sha3_mct(void (*initfn)(sha3_ctx *), sha3_done(&ctx, d.buf); } - if (memcmp(d.buf, out->buf, out->len) != 0) { + if (MEMCMP(d.buf, !=, out->buf, out->len)) { ok = 0; printf("\nfail\n\tsteps = %d\n\tinput = ", n); type_hex.dump(in, stdout); @@ -1037,7 +1038,7 @@ static int vrf_shaky(void (*initfn)(shake_ctx *, p += i; sz -= i; } - if (memcmp(d.buf, want->buf, want->len) != 0) { + if (MEMCMP(d.buf, !=, want->buf, want->len)) { ok = 0; printf("\nfail (get):\n\tstep = %i\n\tinput = ", *ip); type_hex.dump(m, stdout); @@ -1071,7 +1072,7 @@ static int vrf_shaky(void (*initfn)(shake_ctx *, p += i; sz -= i; } - if (memcmp(d.buf, want->buf, want->len) != 0) { + if (MEMCMP(d.buf, !=, want->buf, want->len)) { ok = 0; printf("\nfail (mask):\n\tstep = %i\n\tinput = ", *ip); type_hex.dump(m, stdout); @@ -1131,7 +1132,7 @@ static int vrf_kmac(void (*initfn)(kmac_ctx *, const void *, size_t, if (tsz) kmac_done(&ctx, d.buf, tsz); else { kmac_xof(&ctx); kmac_get(&ctx, d.buf, d.len); } - if (memcmp(d.buf, want->buf, want->len) != 0) { + if (MEMCMP(d.buf, !=, want->buf, want->len)) { ok = 0; printf("\nfail"); printf("\n\tperso = `%s'", perso->buf);