Deploy the new <ctype.h> and `foocmp' macros from mLib.
[catacomb] / symm / gcm-def.h
index 34f95aa..6ca5895 100644 (file)
@@ -815,6 +815,7 @@ GCM_TESTX(PRE, pre, name, fname)
 #include <stdio.h>
 
 #include <mLib/dstr.h>
+#include <mLib/macros.h>
 #include <mLib/quis.h>
 #include <mLib/testrig.h>
 
@@ -876,8 +877,8 @@ static int gcmverify(dstr *v)                                               \
     d.len = BLEN(&b);                                                  \
                                                                        \
     if (d.len != v[4].len ||                                           \
-       memcmp(d.buf, v[4].buf, v[4].len) != 0 ||                       \
-       memcmp(t.buf, v[5].buf, v[5].len) != 0) {                       \
+       MEMCMP(d.buf, !=, v[4].buf, v[4].len) ||                        \
+       MEMCMP(t.buf, !=, v[5].buf, v[5].len)) {                        \
     fail_enc:                                                          \
       printf("\nfail encrypt:\n\tstep = %i", *ip);                     \
       fputs("\n\tkey = ", stdout); type_hex.dump(&v[0], stdout);       \
@@ -918,7 +919,7 @@ static int gcmverify(dstr *v)                                               \
     d.len = BLEN(&b);                                                  \
                                                                        \
     if (d.len != v[3].len || !win ||                                   \
-       memcmp(d.buf, v[3].buf, v[3].len) != 0) {                       \
+       MEMCMP(d.buf, !=, v[3].buf, v[3].len)) {                        \
     fail_dec:                                                          \
       printf("\nfail decrypt:\n\tstep = %i", *ip);                     \
       fputs("\n\tkey = ", stdout); type_hex.dump(&v[0], stdout);       \