code wiki / (root) / nx_p256_solinas_fast.nx

nx_p256_solinas_fast.nx

buildroot/runtime/nx_p256_solinas_fast.nx

5981 B119 linesdepth 5pulls 6 transitivereach 4 importersview sourcekind librarytopic p256
docsdependenciesstructsconstsfunctions

about

nx_p256_solinas_fast.nx -- a FASTER NIST P-256 Solinas reducer, bit-exact with the production _p256_solinas_reduce. The production version issues ~60 _r_addw FUNCTION CALLS, each propagating a carry up a 9-limb memory accumulator on every word add. This version DEFERS the carry: it sums each limb as a wide 64-bit value (max ~6*(2^32-1) < 2^35, no overflow) with plain array adds (no calls, no per-add carry loop), then does ONE normalization pass before the identical reduce/subtract tail. Same S-term table, same _r_reduce9 / _r_cmp8 helpers, same final POS-NEG mod p -> the result is identical (proven by nx_p256_solinas_fast_difftest). Uses NO compiler intrinsic, so it builds with the live compiler; kept SEPARATE so the production reducer is untouched until measured+greenlit. license_tier: ORIGINAL

dependencies 1 imports · 4 importers

nx_p256_field_mul.nx nx_p256_solinas_fast.nx nx_p256_fieldmul_3way_bench.nx nx_p256_fieldmul_full_bench.nx nx_p256_solinas_fast_bench.nx nx_p256_solinas_fast_difftest.nx

imports: nx_p256_field_mul.nx

imported by: nx_p256_fieldmul_3way_bench.nxnx_p256_fieldmul_full_bench.nxnx_p256_solinas_fast_bench.nxnx_p256_solinas_fast_difftest.nx

structs

none

consts

none

functions

12func _p256_solinas_reduce_fast(out8: *i64, c: *i64) -> i64
114func p256_field_reduce_solinas_fast(out_8: *i64, c_16: *i64) -> i64
called by 2: mainmain calls 1: _p256_solinas_reduce_fast