code wiki / _hdl_build / nx_hmaccounter_extvec_gate.nx
nx_hmaccounter_extvec_gate.nx
buildroot/runtime/_hdl_build/nx_hmaccounter_extvec_gate.nx
about
nx_hmaccounter_extvec_gate.nx -- HMAC-SHA-1 over an 8-byte COUNTER, vs RFC 4226 Appendix D Table 1.
CLOSES THE LAST UNGRADED TABLE IN A DOCUMENT ALREADY ON DISK. RFC 4226 Appendix D publishes TWO tables;
Table 2 (the HOTP codes) is graded by nx_hotp_extvec_gate, and Table 1 -- ten RAW HMAC-SHA-1 values keyed
by counter -- sat unused. ★ACQUIRED IS NOT COVERED, and a document is not finished when one of its tables
passes (third time this session: rfc6234/rfc9106 sat pinned-but-ungated, and RFC 4648 needed all four
encodings before it was actually done).
★WHY THIS IS NOT REDUNDANT WITH RFC 2202. RFC 2202 exercises HMAC-SHA-1 over ASCII strings and repeated
byte fills. Table 1 exercises it over an 8-BYTE BIG-ENDIAN COUNTER -- a message that is mostly ZERO bytes
with a low-order value, and exactly the shape HOTP/TOTP feed it in production.
* A PRIMITIVE VALIDATED ONLY ON THE INPUT SHAPES SOMEONE THOUGHT TO PUBLISH IS VALIDATED ONLY ON THOSE
SHAPES. Zero-heavy inputs are where length-handling and padding bugs hide.
The secret is read from the document (`Secret = 0x3132...3930`), never typed from recall.
Document pinned to a CORROBORATED digest (sovereign fetch and .NET WebClient agree).
license_tier: ORIGINAL expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_sha256_wasm.nxnx_hmac_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
| 23 | 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 } |
| 24 | func wb(b: *u8, n: i64) -> i64 { sys_write(1, b, n); return 0 } calls 1: sys_write |
| 26 | func nn(v: i64) -> i64 |
| 40 | func hexnib(v: i64) -> i64 { if v < 10 { return 48 + v } return 87 + v } |
| 41 | func ph(v: i64) -> i64 |
| 48 | func hexval(c: i64) -> i64 called by 1: parsehex_run |
| 54 | func isws(c: i64) -> i64 |
| 61 | func starts(b: *u8, n: i64, at: i64, s: *u8) -> i64 called by 1: findfrom |
| 70 | func findfrom(b: *u8, n: i64, s: *u8, from: i64) -> i64 |
| 75 | func parsehex_run(b: *u8, n: i64, from: i64, out: *u8, want: i64) -> i64 |
| 92 | func next_dec(b: *u8, n: i64, p0: i64, endp: *i64) -> i64 |
| 114 | func skip_ws(b: *u8, n: i64, p0: i64) -> i64 |
| 120 | func main() -> i64 |