code wiki / bin / nx_crypto_bench_full.nx

nx_crypto_bench_full.nx

buildroot/runtime/bin/nx_crypto_bench_full.nx

5092 B152 linesdepth 11pulls 25 transitivereach 0 importersview sourcekind benchtopic crypto
docsdependenciesstructsconstsfunctions

about

nx_crypto_bench_full.nx -- 1:1 bits-up crypto bench vs OpenSSL incumbent. Measures (us/op, MONOTONIC clock, warmed up): 1. p256_kG_generic -- generic double-and-add k*G (PRE-COMB baseline) 2. p256_kG_comb -- fixed-base comb k*G (BITS-UP path) 3. ecdsa_p256_sign -- full sign (generic kG path; no comb file on box) 4. ecdsa_p256_verify -- full verify (u1*G + u2*Q, real signature) 5. x25519_ecdh -- variable-base scalar mult (shared secret) The comb path here is exercised in-memory via p256_comb_build + p256_scalar_mul_base (same code the deploy signer uses when the /volume1/.../p256_comb.bin file is present), so we get the honest comb-vs-generic SPEEDUP without needing the NAS file on disk.

dependencies 10 imports · 0 importers

nx_syscalls.nx nx_csprng.nx nx_u256.nx nx_p256_modn.nx nx_p256_point.nx nx_p256_scalar_mul.nx nx_p256_comb.nx nx_ecdsa_p256.nx nx_ecdsa_p256_sign.nx nx_x25519_ephemeral.nx nx_crypto_bench_full.nx

imports: nx_syscalls.nxnx_csprng.nxnx_u256.nxnx_p256_modn.nxnx_p256_point.nxnx_p256_scalar_mul.nxnx_p256_comb.nxnx_ecdsa_p256.nxnx_ecdsa_p256_sign.nxnx_x25519_ephemeral.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 ↻ sys_mmap ↻ p256_comb_build nx_scratch_save nx_scratch_init ↻ p256_point_alloc ↻ p256_point_load_g ↻ p256_point_copy u256_copy p256_comb_store p256_point_add p256_point_is_infinity u256_is_zero p256_point_copy ↻ nx_scratch_save ↻ u256_alloc ↻ u256_copy ↻ p256_field_sq p256_field_mul nx_scratch_save ↻ u256_wide_alloc nx_scratch ↻ u256_mul_wide

structs

none

consts

none

functions

25func bstrlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != 0 { n = n + 1 } return n }
called by 1: bprint
28func bprint(label: *u8, total_us: i64, n: i64) -> i64
called by 1: main calls 3: sys_writebstrlensys_mmap
62func main() -> i64