code wiki / _hdl_build / nx_pbkdf2sha1_extvec_gate.nx
nx_pbkdf2sha1_extvec_gate.nx
buildroot/runtime/_hdl_build/nx_pbkdf2sha1_extvec_gate.nx
about
nx_pbkdf2sha1_extvec_gate.nx -- PBKDF2-HMAC-SHA1 vs RFC 6070, ALL SIX published vectors.
A NEW AUTHORITY, ACQUIRED THROUGH THE REPAIRED PIPELINE. rfc6070.txt was fetched by nx_vecfetch v2:
HTTP status verified, 720 bytes of response envelope stripped, de-chunked, hashed as a DOCUMENT, and the
digest CORROBORATED against .NET WebClient before a byte was written (CORROBORATION.tsv). Under v1 this
file would have been a wire transcript with Cloudflare headers pinned as "the authority".
★WHY THIS GATE EXISTS: pbkdf2_sha1 is one of the FIVE modules riding the defective sha1.nx core, and it
is one of the TWO I originally missed when I filed the defect (I listed hmac/hkdf/hotp and overlooked
PBKDF2 and TOTP -- password-based key derivation and two-factor codes, the two with the worst blast
radius). ★COUNT THE IMPORT CLOSURE, NOT THE FILES YOU HAPPENED TO GREP.
This gate binds `nx_pbkdf2_sha1.nx` -> nx_hmac_sha1.nx -> nx_sha1.nx (the CORRECT family). Both families
export the identical symbol `pbkdf2_sha1` with an identical signature, so ★THE ONLY THING THAT
DISTINGUISHES THEM IS THE FILE BOUND -- NAME THE FILE, NEVER THE FUNCTION.
⚠THREE READER HAZARDS IN THIS DIALECT, ALL HANDLED EXPLICITLY:
1. P and S are QUOTED ASCII, not hex: P = "password" (8 octets)
2. VECTOR 6 EMBEDS A LITERAL NUL as the two-character sequence \0 :
P = "pass\0word" (9 octets) S = "sa\0lt" (5 octets)
A reader that copies bytes literally yields 10 and 6 octets and silently tests the wrong input. The
declared octet count in the document is what catches this, so it is CROSS-CHECKED on every vector.
3. DK is space-separated hex wrapped across lines and terminated by "(20 octets)". Continuation lines
carry no '=' -- the same structural discriminator used elsewhere in this workstream, because "da",
"Da" and friends are all valid hex and a lexical test cannot separate a value from a label.
⚠VECTOR 5 COSTS 16,777,216 ITERATIONS (~33.5M SHA-1 compressions). It is RUN, not skipped: the authority
published six vectors and grading five while printing GREEN is the coverage-gaming this lane exists to
stop. If it must ever be dropped, it must be dropped LOUDLY with its parameters printed -- never silently.
license_tier: ORIGINAL expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_sha256_wasm.nxnx_pbkdf2_sha1.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
| 35 | 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 } |
| 36 | func wb(b: *u8, n: i64) -> i64 { sys_write(1, b, n); return 0 } |
| 38 | func nn(v: i64) -> i64 |
| 52 | func hexnib(v: i64) -> i64 { if v < 10 { return 48 + v } return 87 + v } |
| 53 | func ph(v: i64) -> i64 |
| 60 | func hexval(c: i64) -> i64 called by 1: readhexrun |
| 66 | func isws(c: i64) -> i64 |
| 73 | func starts(b: *u8, n: i64, at: i64, s: *u8) -> i64 called by 1: findfrom |
| 82 | func findfrom(b: *u8, n: i64, s: *u8, from: i64) -> i64 |
| 90 | func readq(b: *u8, n: i64, from: i64, out: *u8, cap: i64) -> i64 called by 1: main |
| 110 | func readdec_eq(b: *u8, n: i64, from: i64, lim: i64) -> i64 |
| 137 | func readhexrun(b: *u8, n: i64, from: i64, lim: i64, out: *u8, cap: i64) -> i64 |
| 193 | func main() -> i64 |