Deploy the new <ctype.h> and `foocmp' macros from mLib.
[catacomb] / symm / sha3.c
index 1696762..36bd430 100644 (file)
@@ -957,6 +957,7 @@ grand *kmac256_rand(const void *perso, size_t psz, const void *k, size_t sz)
 
 #include <stdio.h>
 
+#include <mLib/macros.h>
 #include <mLib/report.h>
 #include <mLib/testrig.h>
 
@@ -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);