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 committed 2024-04-19 11:43:45 -04:00
1 parent ed2a056f3d
commit 7a33db35cd
2 files changed
+13 -10

No files matched your search

+1 -1
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. */