X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb/blobdiff_plain/e74ca64c0ec65a93d2f133c4472256e3bbb688e2..141c12847a1c2f8cc8db03d420551584e689fb87:/symm/latinpoly-test.c diff --git a/symm/latinpoly-test.c b/symm/latinpoly-test.c index 5a914e50..f7a20763 100644 --- a/symm/latinpoly-test.c +++ b/symm/latinpoly-test.c @@ -27,6 +27,8 @@ /*----- Header files ------------------------------------------------------*/ +#include + #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");