code wiki / (root) / nx_handshake_crypto_bench.nx

nx_handshake_crypto_bench.nx

buildroot/runtime/nx_handshake_crypto_bench.nx

3274 B83 linesdepth 9pulls 12 transitivereach 0 importersview sourcekind bench
docsdependenciesstructsconstsfunctions

about

nx_handshake_crypto_bench.nx -- 1:1 cost of the per-handshake public-key crypto (the suspected ~150ms TLS bottleneck). A TLS 1.3 server handshake does: 1 X25519 ephemeral keygen + 1 X25519 ECDH (shared secret) + 1 Ed25519 signature over the transcript. Measured here with sys_now_us (ms) + __rdtsc (cycles). If keygen+ecdh+sign ~= 150ms, the crypto IS the bottleneck (-> comb-tables). If it's a few ms, the daemon has a per-connection inefficiency elsewhere (-> profile the daemon path). license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_x25519.nx nx_ed25519_signature.nx nx_handshake_crypto_bench.nx

imports: nx_syscalls.nxnx_x25519.nxnx_ed25519_signature.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap fill x25519 nx_scratch_save nx_scratch_init sys_mmap ↻ nx_scratch nx_scratch_init ↻ nx_scratch_oom sys_write sys_exit sys_mmap ↻ fe_alloc nx_scratch ↻ fe_from_bytes fe_one fe_zero fe_zero ↻ fe_copy x25519_ladder_step fe_cswap nx_scratch_save ↻ fe_alloc ↻ fe_add fe_sq fe_mul fe_sub fe_mul ↻ fe_mul_a24 nx_scratch_save ↻ fe_alloc ↻ fe_mul ↻ nx_scratch_restore nx_scratch_restore ↻ fe_cswap ↻ fe_invert nx_scratch_save ↻ fe_alloc ↻ fe_sq ↻

structs

none

consts

none

functions

15func bdec(n: i64) -> i64
called by 2: msfixreport calls 2: sys_writesys_mmap
27func msfix(us: i64) -> i64
called by 2: reportmain calls 2: bdecsys_write
34func fill(p: *u8, n: i64, v: i64) -> i64
called by 1: main
39func report(label: *u8, llen: i64, n: i64, us: i64, cyc: i64) -> i64
called by 1: main calls 3: sys_writemsfixbdec
46func main() -> i64