code wiki / _hdl_build / nx_stream_store_gate.nx

nx_stream_store_gate.nx

buildroot/runtime/_hdl_build/nx_stream_store_gate.nx

4193 B59 linesdepth 6pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic stream
docsdependenciesstructsconstsfunctions

about

nx_stream_store_gate.nx -- GATE for nx_stream_store (M3: stream-hash + incremental store for multi-GB shards). T1 STREAM == ONE-SHOT digest of a 1000-byte pattern streamed in 7-byte chunks == its one-shot sha256. T2 BYTE-IDENTICAL the chunk-by-chunk stored file, read back, equals the input exactly (never-store-corrupt). T3 CHUNK-SIZE-INVARIANT digest streaming in 1-byte chunks == streaming in 7-byte chunks (window size irrelevant). T4 NIST ANCHOR "abc" streamed in 1-byte chunks == the FIPS-180-4 vector ba7816bf...f20015ad. Proves a 16GB shard can be hashed+stored through a tiny window, digest-exact -> feeds the fail-closed pull. GREEN iff T1-T4 pass. Sovereign nx_cc->nxasm. expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_stream_store.nx nx_syscalls.nx nx_stream_store_gate.nx

imports: nx_stream_store.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main w sys_write sys_mmap ss_oneshot 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 ↻ ss_stream_store sys_mmap ↻ sha256_init ↻ sys_openat_wr sha256_update ↻ sys_write ↻ sys_close sha256_final ↻ memeq wn w ↻ sys_mmap ↻ sys_write ↻ sys_openat_rd sys_read sys_close ↻ hexenc streq sys_exit

structs

none

consts

none

functions

11func w(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 2: wnmain calls 1: sys_write
12func wn(v: i64) -> i64 { var m: i64=v; if m<0{w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 }
called by 1: main calls 3: wsys_mmapsys_write
13func memeq(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
14func hexenc(inp: *u8, n: i64, out: *u8) -> i64 { let hx: *u8="0123456789abcdef" as *u8; var i: i64=0; while i<n { out[i*2]=hx[((inp[i] as i64)>>4)&15]; out[i*2+1]=hx[(inp[i] as i64)&15]; i=i+1 } out[n*2]=0 as u8; return n*2 }
called by 1: main
15func streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while 1==1 { if a[i]!=b[i] {return 0} if a[i]==(0 as u8) {return 1} i=i+1 } return 1 }
called by 1: main
17func main() -> i64