code wiki / _hdl_build / nx_access_pep_gate.nx
nx_access_pep_gate.nx
buildroot/runtime/_hdl_build/nx_access_pep_gate.nx
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
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
structs
| none |
consts
| none |
functions
| 11 | func 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 } |
| 12 | func 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 } |
| 13 | func 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 |
| 14 | func 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 } |
| 15 | func 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 } |
| 16 | func pg_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 17 | func pg_mkip(a: i64, b: i64, c: i64, d: i64) -> i64 { return (a << 24) | (b << 16) | (c << 8) | d } called by 1: main |
| 18 | func 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 |
| 19 | func 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 } |
| 22 | func setreq(r: *i64, ip: i64, did: i64, sig: i64, res: i64, rlen: i64, cap: i64, rate: i64) -> i64 called by 1: main |
| 25 | func 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 } |
| 27 | func main() -> i64 |