]> git.codecow.com Git - Monocypher.git/commitdiff
Corrected variable sized buffer in the tests.
authorLoup Vaillant <loup@loup-vaillant.fr>
Sun, 17 Jun 2018 17:06:12 +0000 (19:06 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sun, 17 Jun 2018 17:06:12 +0000 (19:06 +0200)
The p_eddsa_random() test was triggering the TIS interbreter because of
a variable sized array allocated on the stack.  The test run properly
with a fixed sized buffer.  (Variable size buffers are tested elsewhere,
most notably with the test vectors).

tests/test.c

index fdee2bb6c58d51a317630440f29e3668dfd667d9..9397ea1b377b700b4f07e0a2b8a559824700f15e 100644 (file)
@@ -592,10 +592,10 @@ static int p_eddsa_random()
 {
     int status = 0;
     FOR (i, 0, 100) {
-        RANDOM_INPUT(message, i);
+        RANDOM_INPUT(message, MESSAGE_SIZE);
         RANDOM_INPUT(pk, 32);
         RANDOM_INPUT(signature , 64);
-        status |= ~crypto_check(signature, pk, message, i);
+        status |= ~crypto_check(signature, pk, message, MESSAGE_SIZE);
     }
     printf("%s: EdDSA (random)\n", status != 0 ? "FAILED" : "OK");
     return status;