Permit COMB_BITS < 256 for exhaustive tests

This commit is contained in:
Pieter Wuille
2022-01-04 18:46:22 -05:00
parent 39b2f2a321
commit a043940253
7 changed files with 64 additions and 46 deletions

View File

@@ -109,7 +109,7 @@ static void secp256k1_ecmult_gen(const secp256k1_ecmult_gen_context *ctx, secp25
/* Compute the scalar d = (gn + ctx->scalar_offset). */
secp256k1_scalar_add(&d, &ctx->scalar_offset, gn);
/* Convert to recoded array. */
for (i = 0; i < 8; ++i) {
for (i = 0; i < 8 && i < ((COMB_BITS + 31) >> 5); ++i) {
recoded[i] = secp256k1_scalar_get_bits_limb32(&d, 32 * i, 32);
}
secp256k1_scalar_clear(&d);