Deploy the new <ctype.h> and `foocmp' macros from mLib.
[catacomb] / symm / serpent-check.c
index 7f95ffc..190096f 100644 (file)
@@ -32,6 +32,7 @@
 #include <string.h>
 
 #include <mLib/bits.h>
+#include <mLib/macros.h>
 
 #include "serpent-sbox.h"
 
@@ -71,7 +72,7 @@ static int check(unsigned a, unsigned b, unsigned c, unsigned d,
     *q++ = (a & 1) | ((b & 1) << 1) | ((c & 1) << 2) | ((d & 1) << 3);
     a >>= 1; b >>= 1; c >>= 1; d >>= 1;
   }
-  return (memcmp(buf, p, sizeof(buf)));
+  return (MEMCMP(buf, ==, p, sizeof(buf)) ? 0 : -1);
 }
 
 #define CHECK(i) do {                                                  \