From 06e58295d6a8d6afe7686f3aab1bc07f74e2b68a Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Sun, 5 Jul 2020 11:46:13 +0200 Subject: [PATCH] Better test for crypto_x25519_inverse() --- tests/test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test.c b/tests/test.c index 271fd97..a6cb629 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1009,13 +1009,15 @@ static int p_elligator_key_pair_overlap() static int p_x25519_inverse() { int status = 0; - const u8 base [32] = {9}; + RANDOM_INPUT(b, 32); + u8 base[32]; // random point (cofactor is cleared). + crypto_x25519_public_key(base, b); // check round trip FOR (i, 0, 50) { RANDOM_INPUT(sk, 32); u8 pk [32]; u8 blind[32]; - crypto_x25519_public_key(pk, sk); + crypto_x25519(pk, sk, base); crypto_x25519_inverse(blind, sk, pk); status |= memcmp(blind, base, 32); } -- 2.47.3