code wiki / _hdl_build / nx_pbkdf2sha1_extvec_gate.nx

nx_pbkdf2sha1_extvec_gate.nx

buildroot/runtime/_hdl_build/nx_pbkdf2sha1_extvec_gate.nx

14745 B330 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_sha256_wasm.nx nx_pbkdf2_sha1.nx nx_gate_verdict.nx nx_pbkdf2sha1_extvec_gate.nx

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

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 nn

structs

none

consts

none

functions

35func 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
36func wb(b: *u8, n: i64) -> i64 { sys_write(1, b, n); return 0 }
called by 1: main calls 1: sys_write
38func nn(v: i64) -> i64
called by 1: main calls 3: wsys_mmapsys_write
52func hexnib(v: i64) -> i64 { if v < 10 { return 48 + v } return 87 + v }
called by 2: phmain
53func ph(v: i64) -> i64
called by 1: main calls 3: sys_mmaphexnibsys_write
60func hexval(c: i64) -> i64
called by 1: readhexrun
66func isws(c: i64) -> i64
73func starts(b: *u8, n: i64, at: i64, s: *u8) -> i64
called by 1: findfrom
82func findfrom(b: *u8, n: i64, s: *u8, from: i64) -> i64
called by 1: main calls 1: starts
90func readq(b: *u8, n: i64, from: i64, out: *u8, cap: i64) -> i64
called by 1: main
110func readdec_eq(b: *u8, n: i64, from: i64, lim: i64) -> i64
called by 1: main calls 1: isws
137func readhexrun(b: *u8, n: i64, from: i64, lim: i64, out: *u8, cap: i64) -> i64
called by 1: main calls 2: iswshexval
193func main() -> i64