code wiki / _hdl_build / nx_access_pep_gate.nx

nx_access_pep_gate.nx

buildroot/runtime/_hdl_build/nx_access_pep_gate.nx

9146 B144 linesdepth 11pulls 21 transitivereach 0 importersview sourcekind gate/prooftopic access
docsdependenciesstructsconstsfunctions

about

nx_access_pep_gate.nx -- gate for the enforcement-point glue (nx_access_pep). Proves the WHOLE wall composes in one pep_decide call over a request's raw signals: a provisioned device from the public internet with a valid ed25519 signature is ALLOWED; missing device, bad signature, unauthorized resource, rate-limit, and a network-tier shortfall are each DENIED with the right layer code; and pep_audit chains the decisions into a tamper-evident log that verifies. End-to-end, sovereign, NO production touch. Appends "ACCESSGATE row= nx_access_pep enforcement ... verdict=PASS" to knowledge/status/access_gate.log on all-pass. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_access_pep.nx nx_ed25519_signature.nx nx_syscalls.nx nx_access_pep_gate.nx

imports: nx_access_pep.nxnx_ed25519_signature.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 pg_hex2 pg_hb ed25519_pub_from_priv sys_mmap ↻ ed25519_sha512 sys_mmap ↻ sha512_init sha512_update sha512_blk_set_byte blk_get_i64 blk_set_i64 sha512_compress sys_mmap ↻ blk_get_i64 ↻ sha512_gamma0 rotr64_v shr64_v sha512_gamma1 rotr64_v ↻ shr64_v ↻ sha512_sigma1 rotr64_v ↻ sha512_ch sha512_k sha512_sigma0 rotr64_v ↻ sha512_maj sha512_final sha512_blk_set_byte ↻ sha512_compress ↻ ge_p3_alloc sys_mmap ↻ fe_alloc nx_scratch nx_scratch_init sys_mmap ↻ nx_scratch_oom sys_write

structs

none

consts

none

functions

11func pg_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: pg_rowmain calls 1: sys_write
12func pg_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 }
called by 2: pg_rowmain calls 2: sys_mmapsys_write
13func pg_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var k: i64=0; while s[k]!=(0 as u8){dst[o]=s[k];o=o+1;k=k+1} return o }
called by 1: main
14func pg_catnum(dst: *u8, off: i64, v: i64) -> i64 { var o: i64=off; let t: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; var k: i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{dst[o]=t[k-1-i];o=o+1;i=i+1} return o }
called by 1: main calls 1: sys_mmap
15func pg_row(id: i64, ok: i64, what: *u8) -> i64 { pg_w("PEPROW " as *u8); pg_num(id); pg_w(" " as *u8); if ok==1 { pg_w("PASS " as *u8) } else { pg_w("FAIL " as *u8) } pg_w(what); pg_w("\n" as *u8); return ok }
called by 1: main calls 2: pg_wpg_num
16func pg_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: pg_containsmain
17func pg_mkip(a: i64, b: i64, c: i64, d: i64) -> i64 { return (a << 24) | (b << 16) | (c << 8) | d }
called by 1: main
18func pg_hb(c: i64) -> i64 { if c>=0x30 { if c<=0x39 { return c-0x30 } } if c>=0x61 { if c<=0x66 { return c-0x61+10 } } return 0 }
called by 1: pg_hex2
19func pg_hex2(hex: *u8, nb: i64, out: *u8) -> i64 { var i: i64=0; while i<nb { out[i]=((pg_hb(hex[i*2] as i64)<<4)|pg_hb(hex[i*2+1] as i64)) as u8; i=i+1 } return 0 }
called by 1: main calls 1: pg_hb
22func setreq(r: *i64, ip: i64, did: i64, sig: i64, res: i64, rlen: i64, cap: i64, rate: i64) -> i64
called by 1: main
25func pg_contains(buf: *u8, len: i64, ndl: *u8) -> i64 { let nl: i64=pg_slen(ndl); if nl==0 { return 1 } var i: i64=0; while i+nl<=len { var j: i64=0; var m: i64=1; while j<nl { if buf[i+j]!=ndl[j] { m=0; j=nl } else { j=j+1 } } if m==1 { return 1 } i=i+1 } return 0 }
called by 1: main calls 1: pg_slen
27func main() -> i64