A third iteration of the signed-digit multi-comb ecmult_gen algorithm (earlier attempts: #693, and #546 by Peter Dettman). Short summary:
- A new constant-time point multiplication algorithm with precomputation (so only used for multiply with G).
- Based on section 3.3 of https://eprint.iacr.org/2012/309 by Mike Hamburg.
- Configurable through two parameters: COMB_BLOCKS and COMB_TEETH
- Currently only 3 predefined configurations reachable through ./configure. All three are included in precomputed_ecmult_gen.c and tested in CI.
--with-ecmult-gen-kb=2
: 2 kB table with COMB_BLOCKS=2 COMB_TEETH=5--with-ecmult-gen-kb=22
: 22 kB table with COMB_BLOCKS=11 COMB_TEETH=6--with-ecmult-gen-kb=86
: 86 kB table with COMB_BLOCKS=43 COMB_TEETH=6
- Many more configurations can be reached by manually setting the macros. These are not tested.
- Currently only 3 predefined configurations reachable through ./configure. All three are included in precomputed_ecmult_gen.c and tested in CI.
Compared with the previous PR #693:
- Updated to the new static-precomputation-only model (#893).
- Just 3 curated configurations reachable through configure.
- Removed some optimizations that do not matter (much).
- Do blinding through an final correction add rather than an initial start point, which may later permit usage of incomplete addition formulae (#1051).
- The recoding of the input scalar to signed bit representation is done slightly differently, which needs fewer special cases.