code wiki / _hdl_build / nx_sha256_longmsg_gate.nx

nx_sha256_longmsg_gate.nx

buildroot/runtime/_hdl_build/nx_sha256_longmsg_gate.nx

5996 B117 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic sha256
docsdependenciesstructsconstsfunctions

about

nx_sha256_longmsg_gate.nx -- the MISSING KAT row, shipped as a ten-second organ (Doctor+Builder, ENG-BROWSER visit 2026-06-11). WHY: the 2026-06-10 sha256 perf rewrite (HASH-OPT, CAPREG377) was proven byte-identical by a golden diff roll over inputs 0..256 BYTES -- but TLS transcript hashing feeds MULTI-KILOBYTE input through the STREAMING path (init/update/final, arbitrary chunk seams). No gate covered long inputs or streaming==one-shot equivalence. This organ closes that class: K1 abc FIPS 180-2 vector, one-shot K2 two-block-448 FIPS 180-2 vector (56 bytes, crosses one block seam), one-shot K3 million-a FIPS 180-2 LONG vector (1,000,000 bytes), ONE-SHOT K4 million-a-walk same vector via STREAMING updates with a mixed chunk walk (1,63,64,65,255,256,257,1000,4096 cycling -- every buffer-seam residue class) -- streaming must equal the published digest K5 4k-equiv 4096-byte pattern: streaming(100-byte chunks) == one-shot GREEN = the sha256 long/streaming class is exonerated forever (regression-gated); RED = the defect is named mechanically, no human bisect. Durable: SHALONG rows -> knowledge/status/sha256_longmsg.log. Exit 0 iff 5/5. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_sha256.nx nx_sha256_longmsg_gate.nx

imports: nx_syscalls.nxnx_sha256.nx

imported by: nobody (leaf or entry point)

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

main sl_p sys_write sys_openat_append sys_exit 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 ↻ sl_hex sl_row sl_f sys_write ↻ sl_p ↻ sl_eq64 sha256_init ↻ sha256_update ↻ sha256_final ↻ sl_f ↻ sl_n sys_mmap ↻ sys_write ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_close

structs

none

consts

none

functions

20func sl_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 2: sl_rowmain calls 1: sys_write
21func sl_f(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
called by 2: sl_rowmain calls 1: sys_write
22func sl_n(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); 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; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
23func sl_hex(out: *u8, dst: *u8) -> i64
called by 1: main
35func sl_eq64(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while i < 64 { if a[i] != b[i] { return 0 } i = i + 1 } return 1 }
called by 1: main
36func sl_row(lfd: i64, name: *u8, ok: i64, bad: *i64) -> i64
called by 1: main calls 2: sl_fsl_p
43func main() -> i64