From: Loup Vaillant Date: Sun, 17 Jun 2018 18:05:36 +0000 (+0200) Subject: Tests for crypto_verify*() catch more errors X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=5614f339881949bb2d0d0c12648250074e652bfd;p=Monocypher.git Tests for crypto_verify*() catch more errors The test had a symmetry that caused them to miss a possible error, where the implementer would replace an `|` operator by an `&` operator. Breaking that symmetry allow them to catch that error. The other errors are caught all the same. --- diff --git a/tests/test.c b/tests/test.c index 8722e6e..8ee4a78 100644 --- a/tests/test.c +++ b/tests/test.c @@ -262,8 +262,8 @@ static int p_verify(size_t size, int (*compare)(const u8*, const u8*)) a[l] = 0; b[l] = 0; } - a[k] = i; a[k + size/2] = i; - b[k] = j; b[k + size/2] = j; + a[k] = i; a[k + size/2 - 1] = i; + b[k] = j; b[k + size/2 - 1] = j; int cmp = compare(a, b); status |= (i == j ? cmp : ~cmp); }