code wiki / _hdl_build / nx_invite_token_gate.nx

nx_invite_token_gate.nx

buildroot/runtime/_hdl_build/nx_invite_token_gate.nx

5642 B96 linesdepth 6pulls 8 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_invite_token_gate.nx -- SOVEREIGN in-process referee for the invite-token store organ. Drives inv_issue / inv_check / inv_consume against a fresh /tmp store and asserts the FULL lifecycle plus every reject path with real negative controls (no fabricated greens): T1 issue -> check returns the issued level (valid token works) T2 NEG expired: a token valid NOW returns 0 once now_s passes its expiry T3 NEG single-use: check ok -> consume -> re-check returns 0 T4 NEG wrong-realm: a token issued for realm A returns 0 under realm B (and != 0 under A) T5 NEG unknown/garbage token never issued -> 0 T6 independence: two distinct issues; consuming one does NOT void the other GREEN iff 6/6 + sys_exit(0). license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_invite_token.nx nx_syscalls.nx nx_invite_token_gate.nx

imports: nx_invite_token.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 g_w sys_write g_trunc sys_openat_wr sys_close sys_mmap inv_issue sys_mmap ↻ nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd sys_read sys_close ↻ _inv_hex_enc sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word blk_byte sha256_final blk_set_byte ↻ sha256_compress ↻ _inv_cat _inv_catn _inv_i64_dec sys_mmap ↻ _inv_i64_hex16 sys_openat_append sys_write ↻ sys_fsync sys_close ↻

structs

none

consts

none

functions

14func g_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: g_resmain calls 1: sys_write
15func g_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
16func g_num(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
24func g_res(name: *u8, ok: i64) -> i64 { g_w(" " as *u8); g_w(name); if ok == 1 { g_w(": PASS\n" as *u8) } else { g_w(": FAIL\n" as *u8) } return ok }
called by 1: main calls 1: g_w
26func main() -> i64