Deploy the new <ctype.h> and `foocmp' macros from mLib.
[catacomb] / symm / poly1305.c
index c4a88a8..da4594f 100644 (file)
@@ -861,6 +861,7 @@ void poly1305_done(poly1305_ctx *ctx, void *h)
 
 #ifdef TEST_RIG
 
+#include <mLib/macros.h>
 #include <mLib/testrig.h>
 
 #include "ct.h"
@@ -888,7 +889,7 @@ static int vrf_hash(dstr v[])
       poly1305_hash(&ctx, v[2].buf + j, v[2].len - j);
       poly1305_done(&ctx, t.buf);
       ct_remedy(t.buf, t.len);
-      if (memcmp(t.buf, v[3].buf, 16) != 0) {
+      if (MEMCMP(t.buf, !=, v[3].buf, 16)) {
        fprintf(stderr, "failed...");
        fprintf(stderr, "\n\tkey    = "); type_hex.dump(&v[0], stderr);
        fprintf(stderr, "\n\tmask   = "); type_hex.dump(&v[1], stderr);
@@ -932,7 +933,7 @@ static int vrf_cat(dstr v[])
       poly1305_concat(&ctx, &ctx, &cc[2]);
     }
     poly1305_done(&ctx, t.buf);
-    if (memcmp(t.buf, v[5].buf, 16) != 0) {
+    if (MEMCMP(t.buf, !=, v[5].buf, 16)) {
       fprintf(stderr, "failed...");
       fprintf(stderr, "\n\tkey    = "); type_hex.dump(&v[0], stderr);
       fprintf(stderr, "\n\tmask   = "); type_hex.dump(&v[1], stderr);
@@ -997,7 +998,7 @@ static int vrf_mct(dstr v[])
     }
   }
 
-  if (memcmp(t, v[4].buf, 16) != 0) {
+  if (MEMCMP(t, !=, v[4].buf, 16)) {
     ok = 0;
     fprintf(stderr, "failed...");
     fprintf(stderr, "\n\tinitial k = "); type_hex.dump(&v[0], stderr);