code wiki / (root) / md5.nx

md5.nx

buildroot/runtime/md5.nx

8797 B284 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic md5
docsdependenciesstructsconstsfunctions

about

md5.nx -- RFC 1321 MD5 hash. BROKEN cryptographically (collisions constructible in seconds on a laptop since Wang 2004). Never use for signatures. Still needed for interop: - HTTP Digest authentication (RFC 7616 default) - ETag generation in legacy servers (when not using sha) - .iso / .zip / .torrent integrity checks - git-lfs pointer checksums - Content-MD5 header (deprecated but still seen) Algorithm (RFC 1321): Padding: append 1 bit, zero-pad, append 64-bit LE length until total length is multiple of 512 bits. Process in 512-bit blocks; 64 rounds over 4-word state (A, B, C, D) each updated through F/G/H/I round functions. Invariants: M1 Empty string hashes to d41d8cd98f00b204e9800998ecf8427e. M2 State mmap'd per call; no globals. M3 Output is 16 bytes.

dependencies 1 imports · 0 importers

syscalls.nx md5.nx

imports: syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main md5 md5_process_block md5_g md5_k md5_rotl md5_s

structs

none

consts

25const MD5_MASK32: i64 = 0xFFFFFFFF

functions

28func md5_rotl(x: i64, k: i64) -> i64 {
called by 1: md5_process_block
36func md5_s(i: i64) -> i64 {
called by 1: md5_process_block
67func md5_k(i: i64) -> i64 {
called by 1: md5_process_block
135func md5_g(i: i64) -> i64 {
called by 1: md5_process_block
143func md5_process_block(buf: *u8, off: i64, state: *i64) -> i64 {
called by 1: md5 calls 4: md5_gmd5_kmd5_rotlmd5_s
203func md5(data: *u8, n: i64, out: *u8) -> i64 {
called by 1: main calls 1: md5_process_block
269func main() -> i64 {
calls 1: md5