code wiki / _hdl_build / nx_sha256_longmsg_gate.nx
nx_sha256_longmsg_gate.nx
buildroot/runtime/_hdl_build/nx_sha256_longmsg_gate.nx
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
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
structs
| none |
consts
| none |
functions
| 20 | func 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 } |
| 21 | func 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 } |
| 22 | func 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 } |
| 23 | func sl_hex(out: *u8, dst: *u8) -> i64 called by 1: main |
| 35 | func 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 |
| 36 | func sl_row(lfd: i64, name: *u8, ok: i64, bad: *i64) -> i64 |
| 43 | func main() -> i64 |