code wiki / _hdl_build / nx_md5_extvec_gate.nx
nx_md5_extvec_gate.nx
buildroot/runtime/_hdl_build/nx_md5_extvec_gate.nx
about
nx_md5_extvec_gate.nx -- TENTH provably third-party-validated claim: MD5 vs the RFC 1321 test suite.
⚠TWO OF THE SEVEN VECTORS WRAP ACROSS LINES, AND ONE OF THEM WRAPS *INSIDE THE QUOTED INPUT*:
MD5 ("123456789012345678901234567890123456789012345678901234567890123456
78901234567890") = 57edf4a22be3c955ac49da2e2107b67a
A naive "copy bytes until the closing quote" reader would put a newline INTO the message, hash the wrong
bytes, and report a broken MD5. So this reader SKIPS \n and \r while copying a quoted value.
★THAT IS AN ASSUMPTION ABOUT THIS SECTION, AND IT IS STATED RATHER THAN HIDDEN: the RFC 1321 test inputs
are printable ASCII containing no literal newline, so dropping newlines restores exactly the intended
message. It would be WRONG for any document whose test inputs legitimately contain newlines -- do not
lift this reader to such a source without re-proving it.
★Sixth vector dialect of the session. The lesson has not changed once: there is no general parser, only
one proven against the section in front of you.
Construction identical to the other nine: no expected value in this source, document pinned to a digest
nx_vecfetch computed IN-PROCESS AT THE SOCKET, inputs AND digests read from that pinned document, and a
completeness check so a partial read cannot print GREEN.
license_tier: ORIGINAL expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_sha256_wasm.nxnx_md5_canonical.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
| 24 | 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 } |
| 25 | func wb(b: *u8, n: i64) -> i64 { sys_write(1, b, n); return 0 } |
| 27 | func nn(v: i64) -> i64 |
| 41 | func hexnib(v: i64) -> i64 { if v < 10 { return 48 + v } return 87 + v } called by 1: main |
| 43 | func hexval(c: i64) -> i64 called by 1: parsehex |
| 50 | func isws(c: i64) -> i64 called by 1: parsehex |
| 58 | func starts(b: *u8, n: i64, at: i64, s: *u8) -> i64 called by 1: findfrom |
| 68 | func findfrom(b: *u8, n: i64, s: *u8, from: i64) -> i64 |
| 78 | func parseq(b: *u8, n: i64, from: i64, out: *u8, cap: i64, endout: *i64) -> i64 called by 1: main |
| 96 | func parsehex(b: *u8, n: i64, from: i64, out: *u8, want: i64, endout: *i64) -> i64 |
| 118 | func main() -> i64 |