code wiki / _hdl_build / nx_opaque_rfc_kat.nx

nx_opaque_rfc_kat.nx

buildroot/runtime/_hdl_build/nx_opaque_rfc_kat.nx

18144 B335 linesdepth 14pulls 33 transitivereach 0 importersview sourcekind tooltopic opaque
docsdependenciesstructsconstsfunctions

about

nx_opaque_rfc_kat.nx -- ENGINEER gate: OPAQUE-3DH (RFC 9807) vs the RFC's OWN P-256 vectors. Drives the deterministic cores with the fixed randomness from RFC 9807 Appendix C.1.5 (default identities) + C.1.6 (explicit identities "alice"/"bob") and asserts BYTE-EXACT equality on every output message: registration_request, registration_ response, registration_upload, export_key, KE1, KE2, KE3, session_key. One green run validates the ENTIRE stack: VOPRF blind/evaluate/finalize, HashToScalar, DeriveKeyPair, envelope Store/Recover, masking, preamble, 3DH, HKDF key schedule, transcript MACs -- against the standard, not against ourselves. Negative KATs: wrong password => ENVELOPE_AUTH_FAIL; tampered server_mac => SERVER_AUTH_FAIL; tampered KE3 => CLIENT_AUTH_FAIL. Production-randomness round trip: register+login via the CSPRNG wrappers => client/server session keys agree, register/login export keys agree. Vectors staged: knowledge/specs/2026-06-10-rfc9807-opaque-p256-vectors.ref license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_opaque_pake.nx nx_syscalls.nx nx_gate_verdict.nx nx_opaque_rfc_kat.nx

imports: nx_opaque_pake.nxnx_syscalls.nxnx_gate_verdict.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 nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ ok_load_inputs sys_mmap ↻ ok_hex ok_nib ok_hex ↻ ok_mk_ccfg sys_mmap ↻ ok_mk_scfg sys_mmap ↻ ok_run_vector sys_mmap ↻ nx_opaque_create_registrat nx_opq_blind_det sys_mmap ↻ p256_point_alloc nx_scratch nx_scratch_init nx_scratch_oom sys_mmap ↻ u256_alloc nx_scratch ↻ p256_field_one u256_one p256_field_zero

structs

57struct OkVec

consts

none

functions

22func ok_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
23func ok_nib(c: i64) -> i64
called by 1: ok_hex
28func ok_hex(hexs: *u8, out: *u8) -> i64
36func ok_eq(a: *u8, b: *u8, n: i64) -> i64
41func ok_dump(label: *u8, b: *u8, n: i64) -> i64
called by 1: ok_run_vector calls 3: ok_wsys_mmapsys_write
75func ok_load_inputs(v: *OkVec) -> i64
called by 1: main calls 2: sys_mmapok_hex
106func ok_mk_ccfg(v: *OkVec, client_id: *u8, client_id_n: i64, server_id: *u8, server_id_n: i64) -> *NxOpqClientCfg
120func ok_mk_scfg(v: *OkVec, server_id: *u8, server_id_n: i64) -> *NxOpqServerCfg
134func ok_run_vector(
247func ok_run_random_roundtrip(v: *OkVec) -> i64
279func main() -> i64