Deploy the new <ctype.h> and `foocmp' macros from mLib.
[catacomb] / symm / rc4.c
index 214dbc1..4cb0e87 100644 (file)
@@ -296,6 +296,7 @@ grand *rc4_rand(const void *k, size_t sz)
 #include <stdio.h>
 #include <string.h>
 
+#include <mLib/macros.h>
 #include <mLib/quis.h>
 #include <mLib/testrig.h>
 
@@ -310,7 +311,7 @@ static int v_encrypt(dstr *v)
   d.len = v[1].len;
   rc4_encrypt(&ctx, v[1].buf, d.buf, d.len);
 
-  if (memcmp(v[2].buf, d.buf, d.len) != 0) {
+  if (MEMCMP(v[2].buf, !=, d.buf, d.len)) {
     ok = 0;
     printf("\nfail encryption:"
           "\n\tkey        = ");
@@ -336,7 +337,7 @@ static int v_generate(dstr *v)
   d.len = v[2].len;
   rc4_encrypt(&ctx, 0, d.buf, d.len);
 
-  if (memcmp(v[2].buf, d.buf, d.len) != 0) {
+  if (MEMCMP(v[2].buf, !=, d.buf, d.len)) {
     ok = 0;
     printf("\nfail generation:"
           "\n\tkey        = ");