Deploy the new <ctype.h> and `foocmp' macros from mLib.
[catacomb] / symm / latinpoly-test.c
index 5a914e5..f7a2076 100644 (file)
@@ -27,6 +27,8 @@
 
 /*----- Header files ------------------------------------------------------*/
 
+#include <mLib/macros.h>
+
 #include "latinpoly-def.h"
 
 /*----- Main code ---------------------------------------------------------*/
@@ -62,8 +64,9 @@ int latinpoly_test(const gcaead *aec, dstr *v)
   if (rc) { printf("!! encryptdone reports failure\n"); goto encfail; }
 
   out.len = BLEN(&b); tag.len = POLY1305_TAGSZ;
-  if (out.len != v[4].len || memcmp(out.buf, v[4].buf, v[4].len) ||
-      memcmp(tag.buf, v[5].buf, v[5].len)) {
+  if (out.len != v[4].len ||
+      MEMCMP(out.buf, !=, v[4].buf, v[4].len) ||
+      MEMCMP(tag.buf, !=, v[5].buf, v[5].len)) {
   encfail:
     ok = 0;
     printf("\n%s encrypt FAILED", aec->name);
@@ -91,7 +94,8 @@ int latinpoly_test(const gcaead *aec, dstr *v)
   if (rc < 0) { printf("!! decryptdone reports failure\n"); goto decfail; }
 
   out.len = BLEN(&b); tag.len = POLY1305_TAGSZ;
-  if (out.len != v[3].len || memcmp(out.buf, v[3].buf, v[3].len) || !rc) {
+  if (out.len != v[3].len || MEMCMP(out.buf, !=, v[3].buf, v[3].len) ||
+      !rc) {
   decfail:
     ok = 0;
     printf("\ndecrypt FAILED");