code wiki / _hdl_build / nx_vault_v3_gate.nx
nx_vault_v3_gate.nx
buildroot/runtime/_hdl_build/nx_vault_v3_gate.nx
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
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
structs
| none |
consts
| 13 | const AT_FDCWD: i64 = 0 - 100 |
functions
| 14 | func _p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 15 | func _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 } |
| 16 | func vg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 17 | func vg_unlink(path: *u8) -> i64 { __syscall(263, AT_FDCWD, path, 0, 0, 0, 0) return 0 } called by 1: main |
| 19 | func vg_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 34 | func vg_write(path: *u8, buf: *u8, n: i64) -> i64 |
| 43 | func vg_run2(path: *u8, a1: *u8, a2: *u8) -> i64 |
| 66 | func vg_eq(a: *u8, b: *u8, n: i64) -> i64 called by 1: main |
| 72 | func main() -> i64 |