code wiki / _hdl_build / nx_base16_extvec_gate.nx
nx_base16_extvec_gate.nx
buildroot/runtime/_hdl_build/nx_base16_extvec_gate.nx
about
nx_base16_extvec_gate.nx -- validated against RFC4648-10-BASE16, read from the pinned+corroborated RFC4648 document.
RFC 4648 section 10 publishes SEVEN BASE16 vectors; section 8 specifies the Base16 alphabet as
"0123456789ABCDEF" -- UPPERCASE, normatively. runtime/nx_hex_codec.nx's hex_encode emits LOWERCASE.
★★★★★ THE TEMPTING MOVE WAS THE GAMING MOVE, AGAIN: lowercase the authority's expected string before
comparing, and this gate goes GREEN in one line. That is WEAKENING THE AUTHORITY TO FIT THE
IMPLEMENTATION -- the same substitution as writing an Argon2 gate at p=1 because our Argon2 only does
p=1. The published answer does not get edited to match us.
SO THE GATE LOCALISES INSTEAD OF MERELY FAILING. Two tests per vector:
T-EXACT byte-for-byte vs the document -> answers "are we RFC 4648 Base16 conformant?"
T-NOCASE ASCII-case-insensitive comparison -> answers "is the NIBBLE MAPPING right, and only the
alphabet case wrong?"
★A FAILING TEST THAT CANNOT SAY *WHICH PART* FAILED SENDS SOMEONE TO REWRITE THE WHOLE ENCODER. Splitting
the comparison turns "our hex is broken" into "our hex is correct but is not Base16", which is a
one-line remedy (a second, uppercase-alphabet entry point) rather than a rewrite.
⚠SCOPE: this gate binds `nx_hex_codec.nx`. A SECOND `hex_encode` with the same name exists in `hex.nx`
-- the THIRD duplicate-library pair found in this subtree today (after sha1/nx_sha1 and
hkdf_sha1/nx_hkdf_sha1). ★NAME THE FILE YOU BOUND, NOT THE FUNCTION YOU CALLED.
Document pinned to a CORROBORATED digest: the sovereign fetcher and .NET WebClient independently agree
(knowledge/extvec/CORROBORATION.tsv), so the expected values are the IETF's bytes, not ours.
license_tier: ORIGINAL expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_sha256_wasm.nxnx_hex_codec.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
| 31 | 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 } |
| 32 | func wb(b: *u8, n: i64) -> i64 { sys_write(1, b, n); return 0 } |
| 34 | func nn(v: i64) -> i64 |
| 48 | func hexnib(v: i64) -> i64 { if v < 10 { return 48 + v } return 87 + v } called by 1: main |
| 49 | func lc(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c } called by 1: main |
| 51 | func starts(b: *u8, n: i64, at: i64, s: *u8) -> i64 called by 1: findfrom |
| 60 | func findfrom(b: *u8, n: i64, s: *u8, from: i64) -> i64 |
| 68 | func parseq(b: *u8, n: i64, from: i64, out: *u8, cap: i64, endout: *i64) -> i64 called by 1: main |
| 81 | func main() -> i64 |