Select exhaustive lambda in function of order

This commit is contained in:
Pieter Wuille 2020-09-08 10:20:31 -07:00
parent 78f6cdfaae
commit cec7b18a34
2 changed files with 8 additions and 1 deletions

View File

@ -254,6 +254,14 @@ static void secp256k1_scalar_inverse_var(secp256k1_scalar *r, const secp256k1_sc
#ifdef USE_ENDOMORPHISM #ifdef USE_ENDOMORPHISM
#if defined(EXHAUSTIVE_TEST_ORDER) #if defined(EXHAUSTIVE_TEST_ORDER)
# if EXHAUSTIVE_TEST_ORDER == 13
# define EXHAUSTIVE_TEST_LAMBDA 9
# elif EXHAUSTIVE_TEST_ORDER == 199
# define EXHAUSTIVE_TEST_LAMBDA 92
# else
# error No known lambda for the specified exhaustive test group order.
# endif
/** /**
* Find k1 and k2 given k, such that k1 + k2 * lambda == k mod n; unlike in the * Find k1 and k2 given k, such that k1 + k2 * lambda == k mod n; unlike in the
* full case we don't bother making k1 and k2 be small, we just want them to be * full case we don't bother making k1 and k2 be small, we just want them to be

View File

@ -18,7 +18,6 @@
#ifndef EXHAUSTIVE_TEST_ORDER #ifndef EXHAUSTIVE_TEST_ORDER
/* see group_impl.h for allowable values */ /* see group_impl.h for allowable values */
#define EXHAUSTIVE_TEST_ORDER 13 #define EXHAUSTIVE_TEST_ORDER 13
#define EXHAUSTIVE_TEST_LAMBDA 9 /* cube root of 1 mod 13 */
#endif #endif
#include "include/secp256k1.h" #include "include/secp256k1.h"