code wiki / (root) / nx_p256_keyshare_test.nx

nx_p256_keyshare_test.nx

buildroot/runtime/nx_p256_keyshare_test.nx

6610 B175 linesdepth 10pulls 17 transitivereach 0 importersview sourcekind gate/prooftopic p256
docsdependenciesstructsconstsfunctions

about

nx_p256_keyshare_test.nx -- B4-P256-KEYSHARE gate row. Proves the P-256 half of the TLS 1.3 key_share path: A. RFC 5903 section 8.1 ECDH KAT, BOTH directions: pub(i) == (g_ix, g_iy), pub(r) == (g_rx, g_ry) shared(i, pub_r) == g_irx == shared(r, pub_i) (vectors re-read from rfc-editor.org 2026-06-10, not memory) B. Boundary rejects: off-curve point, bad format byte, bad length C. p256_ecdh_derive_priv: deterministic, in-range, usable D. tls13_ext_emit_key_share_dual: byte-exact wire format (lengths, both group ids, both pubkeys in place) Distinct exit code per assertion; exit 0 = row PASS. expect_exit: 0 license_tier: ORIGINAL

dependencies 10 imports · 0 importers

nx_syscalls.nx nx_u256.nx nx_p256_field.nx nx_p256_point.nx nx_p256_point_add.nx nx_p256_scalar_mul.nx nx_p256_modn.nx nx_p256_ecdh.nx nx_tls13.nx nx_tls13_ext.nx nx_p256_keyshare_test.nx

imports: nx_syscalls.nxnx_u256.nxnx_p256_field.nxnx_p256_point.nxnx_p256_point_add.nxnx_p256_scalar_mul.nxnx_p256_modn.nxnx_p256_ecdh.nxnx_tls13.nxnx_tls13_ext.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 kat_w4 sys_mmap ↻ p256_ecdh_pub u256_alloc nx_scratch nx_scratch_init sys_mmap ↻ nx_scratch_oom sys_write sys_exit sys_mmap ↻ _p256_ecdh_load_scalar u256_load_be u256_is_zero u256_alloc ↻ p256_modn_load_n u256_cmp p256_point_alloc nx_scratch ↻ u256_alloc ↻ p256_field_one u256_one u256_zero p256_field_zero u256_zero ↻ p256_point_load_g p256_field_one ↻ 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 p256_point_is_infinity

structs

none

consts

none

functions

30func kat_w4(out: *u8, w0: i64, w1: i64, w2: i64, w3: i64) -> i64
called by 1: main calls 1: sys_mmap
45func kat_eq32(a: *u8, b: *u8) -> i64
called by 1: main
54func main() -> i64