code wiki / _hdl_build / nx_dr_restore_verify_gate.nx

nx_dr_restore_verify_gate.nx

buildroot/runtime/_hdl_build/nx_dr_restore_verify_gate.nx

3172 B48 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic dr
docsdependenciesstructsconstsfunctions

about

nx_dr_restore_verify_gate.nx -- exceed-gate for CAP-DR-RESTORE-VERIFY. Proves the integrity-scrub logic: a faithful copy re-hashes identically (verify OK), a single-byte change is DETECTED (corruption caught), and the hash is a deterministic KAT (sha256("abc")). This is what a naive cp+size-check CANNOT do -> the exceed. Sovereign: nx_syscalls + nx_sha256. expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_sha256.nx nx_gate_verdict.nx nx_dr_restore_verify_gate.nx

imports: nx_syscalls.nxnx_sha256.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main gp sys_write sys_mmap g_hex sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word blk_byte sha256_final blk_set_byte ↻ sha256_compress ↻ g_eq gn sys_write ↻ sys_mmap ↻ gv_ctr sys_mmap ↻ gv_verdict gv_puts sys_write ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻ sys_munmap ↻

structs

none

consts

none

functions

9func gp(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
10func gn(v: i64) -> i64 { var t: i64=v; if t<0{sys_write(1,"-" as *u8,1);t=0-t} let tm:*u8=sys_mmap(24); var k:i64=0; if t==0{tm[0]=48 as u8;k=1} while t>0{tm[k]=(48+(t%10)) as u8;t=t/10;k=k+1} let b:*u8=sys_mmap(24); var j:i64=0; while j<k{b[j]=tm[k-1-j];j=j+1} sys_write(1,b,k); return 0 }
called by 1: main calls 2: sys_writesys_mmap
11func g_hex(buf: *u8, n: i64, out: *u8) -> i64
called by 1: main calls 2: sys_mmapsha256_digest
17func g_eq(a: *u8, b: *u8, n: i64) -> i64 { var i: i64=0; while i<n { if a[i]!=b[i] { return 0 } i=i+1 } return 1 }
called by 1: main
19func main(argc: i64, argv: *i64) -> i64