Skip to content

Commit cec7b18

Browse files
committed
Select exhaustive lambda in function of order
1 parent 78f6cdf commit cec7b18

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/scalar_impl.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,14 @@ static void secp256k1_scalar_inverse_var(secp256k1_scalar *r, const secp256k1_sc
254254

255255
#ifdef USE_ENDOMORPHISM
256256
#if defined(EXHAUSTIVE_TEST_ORDER)
257+
# if EXHAUSTIVE_TEST_ORDER == 13
258+
# define EXHAUSTIVE_TEST_LAMBDA 9
259+
# elif EXHAUSTIVE_TEST_ORDER == 199
260+
# define EXHAUSTIVE_TEST_LAMBDA 92
261+
# else
262+
# error No known lambda for the specified exhaustive test group order.
263+
# endif
264+
257265
/**
258266
* Find k1 and k2 given k, such that k1 + k2 * lambda == k mod n; unlike in the
259267
* full case we don't bother making k1 and k2 be small, we just want them to be

src/tests_exhaustive.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#ifndef EXHAUSTIVE_TEST_ORDER
1919
/* see group_impl.h for allowable values */
2020
#define EXHAUSTIVE_TEST_ORDER 13
21-
#define EXHAUSTIVE_TEST_LAMBDA 9 /* cube root of 1 mod 13 */
2221
#endif
2322

2423
#include "include/secp256k1.h"

0 commit comments

Comments
 (0)