code wiki / (root) / hmac_md5.nx

hmac_md5.nx

buildroot/runtime/hmac_md5.nx

2680 B92 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tooltopic hmac
docsdependenciesstructsconstsfunctions

about

hmac_md5.nx -- HMAC with MD5 (RFC 2104). Like HMAC-SHA1: even though plain MD5 is broken for signatures, HMAC-MD5 remains safe for authentication because HMAC relies on pseudo-randomness of the keyed mix, not collision resistance. Still on the wire in: - RADIUS Access-Request Message-Authenticator (RFC 3579) - CRAM-MD5 SASL auth (IMAP, POP3, SMTP legacy) - Microsoft MS-CHAP-v2 password challenge - NTLMv1 / NTLMv2 (the real world's Windows auth) Composes md5.nx with standard ipad/opad construction. Invariants: HM1 Output = 16 bytes (MD5 tag length). HM2 Matches RFC 2104 Appendix test vectors.

dependencies 2 imports · 0 importers

syscalls.nx nx_md5_canonical.nx hmac_md5.nx

imports: syscalls.nxnx_md5_canonical.nx

imported by: nobody (leaf or entry point)

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

main hmac_md5 md5 sys_mmap md5_process_block sys_mmap ↻ md5_g md5_k md5_rotl md5_s

structs

none

consts

21const HMAC_MD5_BLOCK: i64 = 64
22const HMAC_MD5_OUT: i64 = 16

functions

24func hmac_md5(key: *u8, key_len: i64,
called by 1: main calls 1: md5
75func main() -> i64 {
calls 1: hmac_md5