code wiki / _hdl_build / nx_chacha20_extvec_gate.nx

nx_chacha20_extvec_gate.nx

buildroot/runtime/_hdl_build/nx_chacha20_extvec_gate.nx

11429 B253 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic chacha20
docsdependenciesstructsconstsfunctions

about

nx_chacha20_extvec_gate.nx -- FIFTH provably third-party-validated claim: ChaCha20 block function vs RFC 8439 2.3.2, read from the same pinned document the Poly1305 gate uses. ★★★★★THIS GATE EXISTS BECAUSE ONE DOCUMENT CONTAINS TWO DIALECTS. RFC 8439 states its INPUTS as colon-separated hex (Key = 00:01:...) and its OUTPUT as a HEXDUMP with an offset column and an ASCII gutter: 000 10 f1 e7 e4 d1 3b 59 15 50 0f dd 1f a3 20 71 c4 .....;Y.P.... q. 032 d2 82 64 46 07 9f aa 09 14 c2 d7 05 d9 8b 02 a2 ..dF............ The nibble-stream reader that is CORRECT for the Poly1305 section would produce COMPLETE GARBAGE here: it would swallow the offset column (000/016/032/048 -- every character hex-valid) and then the ASCII gutter (d, F, 3, a, b ... all hex-valid). ★A PARSER PROVEN ON ONE SECTION IS NOT PROVEN ON THE DOCUMENT. THE DISCRIMINATOR, chosen by looking at the layout rather than by guessing: a data byte is a whitespace-delimited token of EXACTLY TWO hex characters. The offset is three characters; the ASCII gutter contains no two-character all-hex token. So "accept only 2-char all-hex tokens" cleanly selects the 64 data bytes and rejects both decorations -- no line/column arithmetic, nothing to drift. ★AND THE TARGET IS THE *SERIALIZED BLOCK*, NOT the "state after 20 rounds" printed just above it. 2.3.2 shows THREE near-identical 16-word blocks (input state, after-20-rounds, and the final serialized output = after-rounds PLUS input state). chacha20_block() returns the THIRD. Comparing against the second is a silent mis-selection that yields a confident RED against a correct implementation -- a document that shows its INTERMEDIATE STATES is more dangerous than one that shows only answers, and the discriminator is SEMANTIC (what does the function return?), never syntactic. license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_sha256_wasm.nx nx_chacha20.nx nx_gate_verdict.nx nx_chacha20_extvec_gate.nx

imports: nx_syscalls.nxnx_sha256_wasm.nxnx_chacha20.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 w sys_write sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close nx_sha256_one_shot _h_set _sha256_compress _blk_word_be _rotr32 _h_get _sha256_k _h_set ↻ _h_get ↻ hexnib wb sys_write ↻ findfrom starts parsenib

structs

none

consts

none

functions

30func 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: nnmain calls 1: sys_write
31func wb(b: *u8, n: i64) -> i64 { sys_write(1, b, n); return 0 }
called by 1: main calls 1: sys_write
33func nn(v: i64) -> i64
called by 1: main calls 3: wsys_mmapsys_write
47func hexnib(v: i64) -> i64 { if v < 10 { return 48 + v } return 87 + v }
called by 1: main
49func hexval(c: i64) -> i64
called by 2: parsenibparsedump
56func isws(c: i64) -> i64
called by 2: parsenibparsedump
64func starts(b: *u8, n: i64, at: i64, s: *u8) -> i64
called by 1: findfrom
74func findfrom(b: *u8, n: i64, s: *u8, from: i64) -> i64
called by 1: main calls 1: starts
84func parsenib(b: *u8, n: i64, from: i64, out: *u8, want: i64) -> i64
called by 1: main calls 2: iswshexval
121func parsedump(b: *u8, n: i64, from: i64, out: *u8, want: i64) -> i64
called by 1: main calls 2: iswshexval
168func main() -> i64