code wiki / _hdl_build / _drv_f1_gate.nx

_drv_f1_gate.nx

buildroot/runtime/_hdl_build/_drv_f1_gate.nx

9328 B176 linesdepth 9pulls 12 transitivereach 0 importersview sourcekind gate/prooftopic drv
docsdependenciesstructsconstsfunctions

about

_drv_f1_gate.nx -- gate for CONSENT-GATED DEVICE TELEMETRY (X-DRV-F1). NO mocks. Drives the REAL nx_telemetry through the full consent lifecycle and asserts the privacy contract: (1) NO-SHARE-BY-DEFAULT -- with a consent file carrying NO opt-in rows, the shared outbox stays EMPTY and the local store is populated. Nothing leaves the device by default. (2) OPT-IN -- a consent row "2 SHARED" makes deviceid=2's record appear in the shared outbox, carrying a signature + the node public key (provenance). (3) SIGNED-VERIFIES -- the shared record's ed25519 signature genuinely verifies over its payload with the published pubkey (ed25519_verify_full == SIG_OK); a TAMPER (flip a payload byte) makes verification FAIL -> the signature really binds the payload, not a decorative tag. (4) REVOKE -- flipping the consent back to "2 LOCAL" makes the next run share NOTHING new. Evidence -> knowledge/status/telemetry.log (DRVF1GATE row). Sovereign. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_ed25519_signature.nx _drv_f1_gate.nx

imports: nx_syscalls.nxnx_ed25519_signature.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main g_p sys_write sys_openat_append g_write_file sys_openat_wr sys_write ↻ sys_close g_truncate sys_openat_wr ↻ sys_close ↻ g_run sys_fork sys_openat_wr ↻ sys_dup3 sys_mmap sys_execve sys_exit sys_wait4 sys_mmap ↻ g_read sys_openat_rd sys_read sys_close ↻ g_count g_strlen g_find g_strlen ↻ g_hexdec ed25519_verify_full sys_mmap ↻ ed25519_s_lt_l sys_mmap ↻ ge_p3_alloc sys_mmap ↻ fe_alloc nx_scratch nx_scratch_init sys_mmap ↻ nx_scratch_oom

structs

none

consts

17const F_TELE: *u8 = "_offc/nx_telemetry.elf"
18const F_DEVMAP: *u8 = "knowledge/registry/emu_devmap.tsv"
19const F_SHARED: *u8 = "knowledge/status/telemetry_shared.log"
20const F_LOCAL: *u8 = "knowledge/status/telemetry_local.log"

functions

22func g_p(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 1: main calls 1: sys_write
23func g_fp(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
called by 1: main calls 1: sys_write
24func g_fn(fd: i64, 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;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(fd,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
26func g_run(prog: *u8, a1: *u8, a2: *u8) -> i64
48func g_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
58func g_write_file(path: *u8, s: *u8) -> i64
65func g_truncate(path: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 0x1a4); if fd >= 0 { sys_close(fd) } return 0 }
called by 1: main calls 2: sys_openat_wrsys_close
67func g_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: g_countg_find
70func g_count(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: main calls 1: g_strlen
79func g_find(buf: *u8, n: i64, from: i64, pat: *u8) -> i64
called by 1: main calls 1: g_strlen
88func g_hexdec(src: *u8, hexlen: i64, out: *u8) -> i64
called by 1: main
104func main() -> i64