code wiki / _hdl_build / nx_hotp_extvec_gate.nx

nx_hotp_extvec_gate.nx

buildroot/runtime/_hdl_build/nx_hotp_extvec_gate.nx

9998 B234 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_hotp_extvec_gate.nx -- HOTP vs RFC 4226 Appendix D, all TEN published values. ★WHY THIS GATE EXISTS: I claimed all session that HOTP/TOTP two-factor codes were BROKEN (they rode the defective sha1.nx core) and that repointing hmac_sha1.nx REPAIRED them. The first half was proven; the second half was INFERRED. I had shown HMAC-SHA-1 now matches RFC 2202 -- I had never once computed an actual HOTP code and compared it to a published one. ★★★★★"THE PRIMITIVE UNDERNEATH IT IS NOW CORRECT" IS NOT THE SAME CLAIM AS "THIS PRODUCES CORRECT OUTPUT." HOTP adds dynamic truncation and modular reduction ON TOP of HMAC; a correct HMAC does not prove a correct truncation, and the truncation is where HOTP implementations actually go wrong. EVERYTHING IS READ FROM THE PINNED DOCUMENT, INCLUDING THE SECRET. RFC 4226 Appendix D states it as Secret = 0x3132333435363738393031323334353637383930 and typing those 20 bytes from memory would put the agent back in the byte path for the one input the whole test depends on. ★THE KEY IS AN ANSWER TOO. ⚠ANCHOR HAZARD, HIT AND FIXED: Appendix D has TWO tables -- Table 1: "Count Hexadecimal HMAC-SHA-1(secret, count)" (raw HMAC values) Table 2: "Count Hexadecimal Decimal HOTP" (truncated + HOTP) Anchoring on "Count Hexadecimal" matches TABLE 1 FIRST and would grade HOTP codes against 20-byte HMAC strings. The anchor below is the full Table-2 header. ★AN ANCHOR THAT IS A PREFIX OF AN EARLIER HEADING FINDS THE EARLIER ONE -- the same class as matching a table of contents instead of the body. Document pinned to a CORROBORATED digest (sovereign fetch and .NET WebClient independently agree -- knowledge/extvec/CORROBORATION.tsv). license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_sha256_wasm.nx nx_hotp_sha1.nx nx_gate_verdict.nx nx_hotp_extvec_gate.nx

imports: nx_syscalls.nxnx_sha256_wasm.nxnx_hotp_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 parsehex

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 hexval(c: i64) -> i64
called by 1: parsehex
55func isws(c: i64) -> i64
called by 2: next_decskip_token
62func starts(b: *u8, n: i64, at: i64, s: *u8) -> i64
called by 1: findfrom
71func findfrom(b: *u8, n: i64, s: *u8, from: i64) -> i64
called by 1: main calls 1: starts
78func parsehex(b: *u8, n: i64, from: i64, out: *u8, want: i64) -> i64
called by 1: main calls 1: hexval
96func next_dec(b: *u8, n: i64, p0: i64, endp: *i64) -> i64
called by 1: main calls 1: isws
120func skip_token(b: *u8, n: i64, p0: i64) -> i64
called by 1: main calls 1: isws
131func main() -> i64