code wiki / _hdl_build / nx_base64alt_extvec_gate.nx

nx_base64alt_extvec_gate.nx

buildroot/runtime/_hdl_build/nx_base64alt_extvec_gate.nx

8651 B193 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_base64alt_extvec_gate.nx -- ADJUDICATES THE base64 DUPLICATE PAIR AGAINST RFC 4648 section 10. Identical to nx_base64_extvec_gate except ONE import: nx_base64_extvec_gate -> nx_base64.nx (7/7 GREEN) nx_base64alt_extvec_gate -> base64.nx (NEVER GRADED, 10 live importers) Both export the same six functions; only the FILE differs. WHY THIS IS NOT PARANOIA: a census of this runtime found 361 X.nx / nx_X.nx pairs. After classifying out 5 byte-identical, 241 orphaned, and 14 shims-that-re-export-their-twin, 101 GENUINE FORKS remain with live importers. TWO of the two forks so far adjudicated against a published authority -- sha1.nx and md5.nx -- were BROKEN, and their closures included HOTP/TOTP/PBKDF2/UUIDv5 and HTTP Digest auth. base64.nx has 10 live importers and a published 7-vector authority sitting already-corroborated on disk, so grading it costs one import line. * AN UNADJUDICATED FORK IS NOT "PROBABLY FINE" -- IT IS AN UNTESTED HYPOTHESIS WITH A 2-FOR-2 PRIOR. // nx_base64alt_extvec_gate.nx -- EIGHTH provably third-party-validated claim, and the first OUTSIDE cryptography: Base64 vs RFC 4648 section 10. ★A FIFTH VECTOR DIALECT. The previous seven gates read hex in four different layouts; RFC 4648 states its vectors as QUOTED ASCII: BASE64("") = "" BASE64("f") = "Zg==" BASE64("foobar") = "Zm9vYmFy" No hex reader touches this. ★The recurring lesson of this session, once more: there is no general parser, only one proven against the section in front of you. Construction unchanged from the other seven: nothing expected appears in this source, the document is pinned to a digest nx_vecfetch computed IN-PROCESS AT THE SOCKET, and every input AND output below is read out of that pinned document at run time. ★THE EMPTY-STRING VECTOR IS KEPT DELIBERATELY. BASE64("") = "" is the case an encoder is most likely to get wrong (a stray pad, a spurious byte) and the one a hand-written test is most likely to omit. The authority published it; we do not get to skip it. license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_sha256_wasm.nx base64.nx nx_gate_verdict.nx nx_base64alt_extvec_gate.nx

imports: nx_syscalls.nxnx_sha256_wasm.nxbase64.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 parseq

structs

none

consts

none

functions

38func 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
39func wb(b: *u8, n: i64) -> i64 { sys_write(1, b, n); return 0 }
called by 1: main calls 1: sys_write
41func nn(v: i64) -> i64
called by 1: main calls 3: wsys_mmapsys_write
55func hexnib(v: i64) -> i64 { if v < 10 { return 48 + v } return 87 + v }
called by 1: main
57func starts(b: *u8, n: i64, at: i64, s: *u8) -> i64
called by 1: findfrom
67func findfrom(b: *u8, n: i64, s: *u8, from: i64) -> i64
called by 1: main calls 1: starts
79func parseq(b: *u8, n: i64, from: i64, out: *u8, cap: i64, endout: *i64) -> i64
called by 1: main
92func main() -> i64