Optimization: move (2^COMB_BITS-1)/2 term into ctx->scalar_offset

It is unnecessary to recompute this term needed by the SDMC algorithm
for every multiplication; move it into the context scalar_offset value
instead.
This commit is contained in:
Pieter Wuille
2021-12-26 18:37:53 -05:00
parent ed2a056f3d
commit 7a33db35cd
2 changed files with 13 additions and 10 deletions

View File

@@ -103,7 +103,7 @@ typedef struct {
/* Values chosen such that
*
* n*G == comb(n + (2^COMB_BITS-1)/2 + scalar_offset, G/2) + ge_offset.
* n*G == comb(n + scalar_offset, G/2) + ge_offset.
*
* This expression lets us use scalar blinding and optimize the comb precomputation. See
* ecmult_gen_impl.h for more details. */