]> git.codecow.com Git - Monocypher.git/commitdiff
Fix last variable length array warning
authorLoup Vaillant <loup@loup-vaillant.fr>
Thu, 21 Sep 2017 07:24:59 +0000 (09:24 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Thu, 21 Sep 2017 07:24:59 +0000 (09:24 +0200)
All gone now. Fixed #37

tests/test.c

index 276a867efb6f5fe141985d0ddca9172147ec96b6..4da42db604e39a2e9aaaf0efda215db43dd44507 100644 (file)
@@ -500,13 +500,13 @@ static int p_sha512()
 // yield an invalid signature).
 static int p_eddsa()
 {
+#define MESSAGE_SIZE 32
     int status = 0;
-    static const size_t message_size = 32;
-    u8 message[message_size];  p_random(message, 32);
+    u8 message[MESSAGE_SIZE];  p_random(message, 32);
     FOR (i, 0, 1000) {
         u8 public_key[32];  p_random(public_key, 32);
         u8 signature [64];  p_random(signature , 64);
-        status |= ~crypto_check(signature, public_key, message, message_size);
+        status |= ~crypto_check(signature, public_key, message, MESSAGE_SIZE);
     }
     printf("%s: EdDSA\n", status != 0 ? "FAILED" : "OK");
     return status;