code wiki / _hdl_build / nx_realm_isolation_gate.nx

nx_realm_isolation_gate.nx

buildroot/runtime/_hdl_build/nx_realm_isolation_gate.nx

5343 B91 linesdepth 15pulls 43 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_realm_isolation_gate.nx -- PROVES per-site OPAQUE realm isolation (operator 2026-06-17: "don't allow andelinwest.com to share the same as nishifamily.com -- each site a SEPARATE opaque login"). Arms TWO realms with SEPARATE keys + stores + realm_ids (nishifamily, andelinwest), registers + logs in a user in each via the REAL Modern Auth (OPAQUE-3DH), then CROSS-VALIDATES: a token minted for one realm MUST be rejected by the other. This is the multi-tenant separation property: no token crosses site boundaries. T1 nishifamily token on nishifamily ctx -> OK T2 nishifamily token on andelinwest ctx -> DENY (isolation: a family token is useless on the law firm) T3 andelinwest token on andelinwest ctx -> OK T4 andelinwest token on nishifamily ctx -> DENY (isolation: a client/lawyer token is useless on the family hub) Sovereign: nx_modern_auth_flow + nx_syscalls. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_modern_auth_flow.nx nx_syscalls.nx nx_realm_isolation_gate.nx

imports: nx_modern_auth_flow.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 ri_w sys_write ri_trunc sys_openat_wr sys_close sys_mmap ri_arm ri_len sys_mmap ↻ nx_uas_server_keys_load_or sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻ _uas_hex_dec _uas_nib nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd ↻ sys_read ↻ sys_close ↻ nx_opq_derive_keypair sys_mmap ↻ _voprf_load_context_string u256_alloc nx_scratch nx_scratch_init nx_scratch_oom sys_mmap ↻ nx_opq_hash_to_scalar sys_mmap ↻ nx_h2c_expand_message_xmd_ sys_mmap ↻ _h2c_i2osp_1 _h2c_i2osp_2

structs

none

consts

none

functions

14func ri_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: ri_rowmain calls 1: sys_write
15func ri_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: ri_armmain
16func ri_row(name: *u8, ok: i64) -> i64 { if ok==1 { ri_w(" PASS " as *u8) } else { ri_w(" FAIL " as *u8) } ri_w(name); ri_w("\n" as *u8); return ok }
called by 1: main calls 1: ri_w
17func ri_trunc(path: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 0x180); if fd >= 0 { sys_close(fd) } return 0 }
called by 1: main calls 2: sys_openat_wrsys_close
20func ri_arm(keys: *u8, store: *u8, realm: *u8, handle: *u8, pass: *u8, ctx: *NxAuthContext, tok: *u8, tokn: *i64) -> i64
39func ri_validate(ctx: *NxAuthContext, tok: *u8, tok_n: i64, now_s: i64) -> i64
45func main() -> i64