code wiki / _hdl_build / nx_base16_extvec_gate.nx

nx_base16_extvec_gate.nx

buildroot/runtime/_hdl_build/nx_base16_extvec_gate.nx

10001 B200 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_sha256_wasm.nx nx_hex_codec.nx nx_gate_verdict.nx nx_base16_extvec_gate.nx

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

main w sys_write gv_ctr 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_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close gv_need gv_puts sys_write ↻ gv_verdict gv_note_bare_rate gv_bare_rate gv_at gv_obj_has_n gv_at ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻

structs

none

consts

none

functions

31func 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
32func wb(b: *u8, n: i64) -> i64 { sys_write(1, b, n); return 0 }
called by 1: main calls 1: sys_write
34func nn(v: i64) -> i64
called by 1: main calls 3: wsys_mmapsys_write
48func hexnib(v: i64) -> i64 { if v < 10 { return 48 + v } return 87 + v }
called by 1: main
49func lc(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c }
called by 1: main
51func starts(b: *u8, n: i64, at: i64, s: *u8) -> i64
called by 1: findfrom
60func findfrom(b: *u8, n: i64, s: *u8, from: i64) -> i64
called by 1: main calls 1: starts
68func parseq(b: *u8, n: i64, from: i64, out: *u8, cap: i64, endout: *i64) -> i64
called by 1: main
81func main() -> i64