]> git.codecow.com Git - Monocypher.git/commitdiff
Fixed buffer length in test.
authorLoup Vaillant <loup@loup-vaillant.fr>
Mon, 25 Nov 2019 22:29:39 +0000 (23:29 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Mon, 25 Nov 2019 22:35:56 +0000 (23:35 +0100)
The buffers tested for equality were too short.  Now we test the whole
of them.

Note: this may not be the only instance of this error.

tests/test.c

index 5d173c28681f18a7b334a4df69720bbd044cb3a9..3e40d9d431ad20e4fbb37b03b2e555396d2f0841 100644 (file)
@@ -257,7 +257,7 @@ static int p_chacha20_same_ptr()
     RANDOM_INPUT(nonce, 8);
     crypto_chacha20(output, input, INPUT_SIZE, key, nonce);
     crypto_chacha20(input , input, INPUT_SIZE, key, nonce);
-    status |= memcmp(output, input, CHACHA_BLOCK_SIZE);
+    status |= memcmp(output, input, INPUT_SIZE);
     printf("%s: Chacha20 (output == input)\n", status != 0 ? "FAILED" : "OK");
     return status;
 }