code wiki / _hdl_build / nx_opaque_rfc_kat.nx

nx_opaque_rfc_kat.nx

buildroot/runtime/_hdl_build/nx_opaque_rfc_kat.nx

17294 B327 linesdepth 14pulls 32 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 2 imports · 0 importers

nx_opaque_pake.nx nx_syscalls.nx nx_opaque_rfc_kat.nx

imports: nx_opaque_pake.nxnx_syscalls.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 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 ↻ _voprf_load_dst_h2c sys_mmap ↻ _voprf_load_context_string 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 u256_zero nx_h2c_hash_to_curve_p256 sys_mmap ↻ nx_h2c_hash_to_field_p256 sys_mmap ↻ nx_h2c_expand_message_xmd_ _h2c_reduce_48be_mod_p u256_alloc ↻ _h2c_map_to_curve_sswu_p25 u256_alloc ↻ _h2c_load_A_neg3

structs

56struct OkVec

consts

none

functions

21func 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 }
22func ok_nib(c: i64) -> i64
called by 1: ok_hex
27func ok_hex(hexs: *u8, out: *u8) -> i64
35func ok_eq(a: *u8, b: *u8, n: i64) -> i64
40func ok_dump(label: *u8, b: *u8, n: i64) -> i64
called by 1: ok_run_vector calls 3: ok_wsys_mmapsys_write
74func ok_load_inputs(v: *OkVec) -> i64
called by 1: main calls 2: sys_mmapok_hex
105func ok_mk_ccfg(v: *OkVec, client_id: *u8, client_id_n: i64, server_id: *u8, server_id_n: i64) -> *NxOpqClientCfg
119func ok_mk_scfg(v: *OkVec, server_id: *u8, server_id_n: i64) -> *NxOpqServerCfg
133func ok_run_vector(
246func ok_run_random_roundtrip(v: *OkVec) -> i64
278func main() -> i64