code wiki / (root) / nx_p256_verify_bench.nx

nx_p256_verify_bench.nx

buildroot/runtime/nx_p256_verify_bench.nx

2759 B59 linesdepth 11pulls 23 transitivereach 0 importersview sourcekind benchtopic p256
docsdependenciesstructsconstsfunctions

about

nx_p256_verify_bench.nx -- end-to-end ECDSA P-256 verify throughput (u1*G + u2*Q double-and-add). Mirrors runtime/bin/nx_bench_verify but lives where nx_sov_build_run / nx_cand_build_run find it, so the SAME bench measures the production stack (live toolchain) AND -- when nx_p256_field_mul is temporarily routed to the fused-mulx + fast-reduce path -- the optimized stack (candidate compiler). This is the true Amdahl-real end-to-end number for the field-mul optimization. expect_exit: 0 license_tier: ORIGINAL

dependencies 9 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_csprng.nx nx_u256.nx nx_p256_modn.nx nx_p256_point.nx nx_p256_scalar_mul.nx nx_ecdsa_p256.nx nx_ecdsa_p256_sign.nx nx_p256_verify_bench.nx

imports: nx_syscalls.nxnx_itoa_lib.nxnx_csprng.nxnx_u256.nxnx_p256_modn.nxnx_p256_point.nxnx_p256_scalar_mul.nxnx_ecdsa_p256.nxnx_ecdsa_p256_sign.nx

imported by: nobody (leaf or entry point)

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

main u256_alloc nx_scratch nx_scratch_init sys_mmap nx_scratch_oom sys_write sys_exit sys_mmap ↻ sys_mmap ↻ nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd sys_read sys_close u256_load_be nx_ecdsa_p256_sign nx_scratch_save nx_scratch_init ↻ _nx_ecdsa_p256_sign_impl u256_is_zero u256_alloc ↻ p256_modn_load_n u256_copy p256_modn_reduce nx_scratch_save ↻ u256_alloc ↻ p256_modn_load_n ↻ u256_copy ↻ u256_cmp u256_sub_with_borrow nx_scratch_restore u256_eq nx_scratch ↻ u256_store_be _ecdsa_sign_derive_k nx_scratch_save ↻ nx_scratch ↻ drbg_hmac_init

structs

none

consts

16const K_MAGIC_1000000000: i64 = 1000000000
26const NV: i64 = 200

functions

18func vb_puts(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
23func vb_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
24func vb_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
28func main() -> i64