nx_p256_scalar_mul_wnaf.nx
buildroot/runtime/nx_p256_scalar_mul_wnaf.nx
about
nx_p256_scalar_mul_wnaf.nx -- variable-base scalar mult via width-4 wNAF (signed non-adjacent form).
For the ECDSA verify's u2*Q (Q varies -> no fixed-base comb). Fewer point additions than the plain
binary double-and-add: ~256/(4+1) ~= 51 adds instead of ~128. Precomputes the odd multiples
{1,3,5,7}*Q (+ their negatives), recodes the scalar to signed digits, one double + conditional
signed add per step. Variable-time is safe for verify (public scalars). Proven bit-identical to
p256_scalar_mul by nx_p256_wnaf_difftest over many random scalars. license_tier: ORIGINAL
dependencies 5 imports · 4 importers
imports: nx_syscalls.nxnx_u256.nxnx_p256_field.nxnx_p256_point.nxnx_p256_point_add.nx
imported by: nx_ecdsa_p256.nxnx_p256_ecverify_core_bench.nxnx_p256_wnaf_bench.nxnx_p256_wnaf_difftest.nx
structs
| none |
consts
| none |
functions
| 14 | func p256_point_neg(out: *P256Point, p: *P256Point) -> i64 |
| 24 | func p256_scalar_mul_wnaf(out: *P256Point, k_8: *i64, p: *P256Point) -> i64 |