code wiki / _hdl_build / nx_opaque_rfc_kat.nx
nx_opaque_rfc_kat.nx
buildroot/runtime/_hdl_build/nx_opaque_rfc_kat.nx
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
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
structs
| 56 | struct OkVec |
consts
| none |
functions
| 21 | func 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 } |
| 22 | func ok_nib(c: i64) -> i64 called by 1: ok_hex |
| 27 | func ok_hex(hexs: *u8, out: *u8) -> i64 |
| 35 | func ok_eq(a: *u8, b: *u8, n: i64) -> i64 |
| 40 | func ok_dump(label: *u8, b: *u8, n: i64) -> i64 |
| 74 | func ok_load_inputs(v: *OkVec) -> i64 |
| 105 | func ok_mk_ccfg(v: *OkVec, client_id: *u8, client_id_n: i64, server_id: *u8, server_id_n: i64) -> *NxOpqClientCfg |
| 119 | func ok_mk_scfg(v: *OkVec, server_id: *u8, server_id_n: i64) -> *NxOpqServerCfg |
| 133 | func ok_run_vector( |
| 246 | func ok_run_random_roundtrip(v: *OkVec) -> i64 |
| 278 | func main() -> i64 |