]> git.codecow.com Git - Monocypher.git/commitdiff
More sensitive constant timing test
authorLoup Vaillant <loup@loup-vaillant.fr>
Sun, 6 Aug 2017 21:33:44 +0000 (23:33 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sun, 6 Aug 2017 21:34:36 +0000 (23:34 +0200)
32 bytes buffers weren't big enough to make a difference if crypto_memcmp
and crypto_zerocmp don't run in constant time.  Increased to 64Kib instead.

tests/self.c

index 4ac22927c8ac92dec45709adc516bbe0a6b659fb..6e27fa36a50f2adf1384c62a1f111fb8ed895ff9 100644 (file)
@@ -296,8 +296,8 @@ static u64 rand64()
 // Tests that constant-time comparison is actually constant-time.
 static int test_cmp()
 {
-    u8 va[32] = {0};
-    u8 vb[32] = {0};
+    u8 va[1024 * 64] = {0};
+    u8 vb[1024 * 64] = {0};
     clock_t t1, t2, d;
     int status = 0;