code wiki / _hdl_build / nx_vault_selftest.nx

nx_vault_selftest.nx

buildroot/runtime/_hdl_build/nx_vault_selftest.nx

4833 B97 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic vault
docsdependenciesstructsconstsfunctions

about

nx_vault_selftest.nx -- SECURITY SELF-TEST: the vault's three guarantees re-proven mechanically, so they become a STANDING proof obligation under nx_prove_all (a security property is only real if it is CONTINUOUSLY re-verified, not asserted once). Exercises the REAL bootstrap-built _offc/nx_vault.elf via fork/exec (so this gate stays sovereign-buildable -- no crypto import that hits the nxasm gap). Proves: (1) seal->open ROUNDTRIP recovers the secret; (2) the vault file holds NO plaintext; (3) a WRONG passphrase FAILS CLOSED (no output). Exit 0 iff all three hold. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_vault_selftest.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 sys_mmap vs_write sys_openat_wr sys_write ↻ sys_close vs_run sys_fork sys_mmap ↻ sys_execve sys_exit sys_wait4 vs_read sys_openat_rd sys_read sys_close ↻ vs_contains vs_unlink sys_openat_rd ↻ sys_close ↻ sys_exit ↻

structs

none

consts

9const AT_MAGIC_65536: i64 = 65536
10const AT_FDCWD: i64 = 0 - 100

functions

11func _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
12func vs_run(path: *u8, a1: *u8, a2: *u8) -> i64
30func vs_write(path: *u8, s: *u8, n: i64) -> i64
37func vs_read(path: *u8, out: *u8, cap: i64, lenbox: *i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
47func vs_contains(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: main
55func main() -> i64