code wiki / _hdl_build / nx_hmacmd5_extvec_gate.nx
nx_hmacmd5_extvec_gate.nx
buildroot/runtime/_hdl_build/nx_hmacmd5_extvec_gate.nx
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
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
structs
| none |
consts
| none |
functions
| 32 | 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 } |
| 33 | func wb(b: *u8, n: i64) -> i64 { sys_write(1, b, n); return 0 } |
| 35 | func nn(v: i64) -> i64 |
| 49 | func hexnib(v: i64) -> i64 { if v < 10 { return 48 + v } return 87 + v } |
| 51 | func hexval(c: i64) -> i64 called by 1: parserun |
| 58 | func isws(c: i64) -> i64 called by 1: parserun |
| 66 | func starts(b: *u8, n: i64, at: i64, s: *u8) -> i64 called by 1: findfrom |
| 76 | func findfrom(b: *u8, n: i64, s: *u8, from: i64) -> i64 |
| 87 | func parserun(b: *u8, n: i64, from: i64, out: *u8, cap: i64) -> i64 |
| 191 | func find_key_label(b: *u8, n: i64, from: i64) -> i64 calls 1: findfrom |
| 204 | func readdec(b: *u8, n: i64, from: i64) -> i64 |
| 224 | func readdec_skipeq(b: *u8, n: i64, from: i64) -> i64 |
| 234 | func readfield(b: *u8, n: i64, from: i64, out: *u8, cap: i64) -> i64 |
| 306 | func ph(v: i64) -> i64 |
| 324 | func ref_hmac_md5(key: *u8, klen: i64, msg: *u8, mlen: i64, out: *u8) -> i64 |
| 327 | func main() -> i64 |