code wiki / (root) / nx_p256_wnaf_bench.nx

nx_p256_wnaf_bench.nx

buildroot/runtime/nx_p256_wnaf_bench.nx

2399 B52 linesdepth 9pulls 14 transitivereach 0 importersview sourcekind benchtopic p256
docsdependenciesstructsconstsfunctions

about

nx_p256_wnaf_bench.nx -- is wNAF-4 actually faster than generic double-and-add for variable-base k*P (the verify's u2*Q)? Includes the per-call precompute (odd multiples + negations + recode), exactly as verify would pay it. Dependent-chain (DCE-proof). expect_exit: 0 license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_csprng.nx nx_p256_scalar_mul_wnaf.nx nx_p256_scalar_mul.nx nx_p256_wnaf_bench.nx

imports: nx_syscalls.nxnx_csprng.nxnx_p256_scalar_mul_wnaf.nxnx_p256_scalar_mul.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main p256_point_alloc nx_scratch nx_scratch_init sys_mmap nx_scratch_oom sys_write sys_exit sys_mmap ↻ u256_alloc nx_scratch ↻ p256_field_one u256_one u256_zero p256_field_zero u256_zero ↻ p256_point_load_g p256_field_one ↻ u256_alloc ↻ sys_mmap ↻ nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd sys_read sys_close u256_load_be bp sys_write ↻ now_ns p256_scalar_mul nx_scratch_save nx_scratch_init ↻ p256_point_alloc ↻ p256_point_copy u256_copy p256_point_zero p256_field_one ↻ p256_field_zero ↻ p256_point_double

structs

none

consts

8const K_MAGIC_1000000000: i64 = 1000000000
10const NI: i64 = 400

functions

12func bp(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
13func bn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
19func now_ns(ts: *i64) -> i64 { __syscall(SYS_CLOCK_GETTIME, 1, ts as i64, 0, 0, 0, 0); return ts[0] * K_MAGIC_1000000000 + ts[1] }
called by 1: main
21func main() -> i64