Commit d22cd8a
k256: use group crate WnafBase/WnafScalar for GLV vartime mul
Replace custom wNAF implementation (wnaf_128, build_odd_multiples,
WnafSlot, wnaf_ladder) with the group crate's WnafBase/WnafScalar
types and WnafBase::multiscalar_mul_array.
A new WnafScalar::from_le_bytes constructor accepts short (128-bit)
GLV half-scalars, producing ~half the wNAF digits and ~half the
doublings in the evaluation loop. multiscalar_mul_array avoids the
two collect() heap allocations of the iterator-based multiscalar_mul.
Depends on RustCrypto/group#15 for the group
crate changes (wnaf_table size fix, from_le_bytes, multiscalar_mul_array,
pre-sized Vec allocations).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent d559afc commit d22cd8a
3 files changed
Lines changed: 81 additions & 229 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
0 commit comments