code wiki / _hdl_build / nx_hmacmd5_extvec_gate.nx

nx_hmacmd5_extvec_gate.nx

buildroot/runtime/_hdl_build/nx_hmacmd5_extvec_gate.nx

28090 B507 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_hmacmd5_extvec_gate.nx -- validated against RFC2202-HMAC-MD5, read from the pinned+corroborated RFC2202 document. ⚠HEADER CORRECTED 2026-08-01: this file was CLONED from nx_hmac_extvec_gate.nx and inherited its header verbatim, so it claimed to be that gate validating HMAC-SHA-256 against RFC 4231. Nine of twenty-three extvec gates carried the same wrong self-description. ★★★★★A CLONED FILE INHERITS ITS PARENT'S CLAIMS, AND ON AN EVIDENCE ARTIFACT THE HEADER IS A PROVENANCE CLAIM, NOT A COMMENT -- an auditor reading headers would have concluded RFC 4231 validated all nine subjects. SUPERSEDES the single-case version. Going from 1 vector to 7 matters because the cases are deliberately chosen by the authority to hit DIFFERENT code paths, and the ones I was NOT running are the interesting ones: case 3 uses a 50-byte repeated data block, cases 6 and 7 use a 131-BYTE KEY (longer than the 64-byte SHA-256 block, so the key must be HASHED first), and case 5 publishes a TRUNCATED 128-bit MAC. ★A gate that ran only case 1 would never touch the key-longer-than-block branch -- the single most commonly botched part of HMAC. Running one vector from a seven-vector suite is not "validated against RFC 4231"; it is validated against one line of it. ⚠VARIABLE-LENGTH FIELDS, HANDLED BY TERMINATOR NOT BY LENGTH. Key/Data lengths differ per case and their annotations are inconsistent -- "(20 bytes)" for keys but ("Hi There") for data -- so a length cannot be read uniformly. Instead the hex run is read until the first `(`, which terminates both forms. ⚠THE MAC HAS NO `(` TERMINATOR and case 5's is TRUNCATED to 16 bytes, so it is read as hex pairs until a pair is not both-hex, capped at 32. That correctly stops at the section heading that follows -- note "4.3." begins with '4', a HEX DIGIT, and is only rejected because '.' is not: the PAIR rule saves this, a single-nibble rule would have swallowed it. Construction unchanged: no expected value in this source, document pinned to a socket-time digest, every key/data/MAC read from that pinned document, and a completeness check that refuses GREEN below 7. license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_sha256_wasm.nx nx_hmac_md5.nx nx_gate_verdict.nx nx_hmacmd5_extvec_gate.nx

imports: nx_syscalls.nxnx_sha256_wasm.nxnx_hmac_md5.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 readfield

structs

none

consts

none

functions

32func 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
33func wb(b: *u8, n: i64) -> i64 { sys_write(1, b, n); return 0 }
called by 1: main calls 1: sys_write
35func nn(v: i64) -> i64
called by 1: main calls 3: wsys_mmapsys_write
49func hexnib(v: i64) -> i64 { if v < 10 { return 48 + v } return 87 + v }
called by 2: phmain
51func hexval(c: i64) -> i64
called by 1: parserun
58func isws(c: i64) -> i64
called by 1: parserun
66func starts(b: *u8, n: i64, at: i64, s: *u8) -> i64
called by 1: findfrom
76func findfrom(b: *u8, n: i64, s: *u8, from: i64) -> i64
called by 3: find_key_labelreadfieldmain calls 1: starts
87func parserun(b: *u8, n: i64, from: i64, out: *u8, cap: i64) -> i64
called by 1: readfield calls 2: iswshexval
191func find_key_label(b: *u8, n: i64, from: i64) -> i64
calls 1: findfrom
204func readdec(b: *u8, n: i64, from: i64) -> i64
224func readdec_skipeq(b: *u8, n: i64, from: i64) -> i64
called by 1: main calls 1: readdec
234func readfield(b: *u8, n: i64, from: i64, out: *u8, cap: i64) -> i64
called by 1: main calls 3: parserunfindfromreaddec
306func ph(v: i64) -> i64
called by 1: main calls 3: sys_mmaphexnibsys_write
324func ref_hmac_md5(key: *u8, klen: i64, msg: *u8, mlen: i64, out: *u8) -> i64
called by 1: main calls 1: hmac_md5
327func main() -> i64