code wiki / _hdl_build / nx_stream_store_gate.nx
nx_stream_store_gate.nx
buildroot/runtime/_hdl_build/nx_stream_store_gate.nx
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
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
structs
| none |
consts
| none |
functions
| 11 | func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 12 | func 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 } |
| 13 | func 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 |
| 14 | func 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 |
| 15 | func 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 |
| 17 | func main() -> i64 |