code wiki / _hdl_build / nx_vault_v3_gate.nx

nx_vault_v3_gate.nx

buildroot/runtime/_hdl_build/nx_vault_v3_gate.nx

6831 B147 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind gate/prooftopic vault
docsdependenciesstructsconstsfunctions

about

nx_vault_v3_gate.nx -- re-runnable GATE for the v3 vault format (Engineer verb: VERIFY). Tests the INSTALLED _offc/nx_vault.elf (install-then-gate; rollback bak kept). K1 v3 seal/open round-trip byte-exact K2 re-seal SAME path + SAME value -> vault FILES DIFFER (random salt+iv embedded). This is THE rotation-safety property: under v2's path-derived iv, re-sealing was AES-GCM nonce reuse. K2 failing = rotation is forbidden again. K3 tampered ciphertext byte -> open FAILS CLOSED K4 legacy v2 vault (sealed by _offc/nx_vault.elf.bak-pre-v3-20260610) still OPENS K5 LIVE prod back-compat: nx_secret_cli get nas exits 0 (real v2 nas.nv on this machine) Exit 0 only on 5/5. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_vault_v3_gate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main _p sys_write vg_write sys_openat_wr sys_write ↻ sys_close vg_unlink vg_run2 sys_fork sys_openat_wr ↻ sys_dup3 sys_mmap sys_execve sys_exit sys_wait4 sys_mmap ↻ vg_read sys_openat_rd sys_read sys_close ↻ vg_eq _pn sys_mmap ↻ sys_write ↻ sys_exit ↻

structs

none

consts

13const AT_FDCWD: i64 = 0 - 100

functions

14func _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
15func _pn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; 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);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 1: main calls 2: sys_mmapsys_write
16func vg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
19func vg_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
34func vg_write(path: *u8, buf: *u8, n: i64) -> i64
43func vg_run2(path: *u8, a1: *u8, a2: *u8) -> i64
66func vg_eq(a: *u8, b: *u8, n: i64) -> i64
called by 1: main
72func main() -> i64