Commit Graph
5 Commits
Author SHA1 Message Date
kyle 7755be49e9 Fix SHA-256 padding bug for messages of length 63 mod 64
pad_message wrote 0x00 into the last byte of the current block and
deferred the 0x80 pad byte to the next block when mbi == 63, producing
incorrect digests for every message whose length is 63 mod 64 (and
correspondingly wrong HMAC tags). Always write the pad byte in the
current block first, then flush an extra block only when the 8-byte
length field no longer fits.

Adds regression tests for SHA-256 boundary lengths 55/56/63/64/65 and
HMAC with a 63-byte message. Bumps to 1.0.4 for crates.io publication.

Ref: docs/LAGUNA-AUDIT.md
2026-09-17 12:25:23 -07:00
kyle 65c4b220ae Minor doc, format, and clippy fixes. 2025-12-29 11:26:18 -07:00
kyle 014f6ea2d6 refactor; add bin. 2025-12-29 11:17:06 -07:00
kyle f80204aced Minor fixups and doc updates. 2025-12-29 02:03:32 -07:00
kyle ddf44d7e33 Initial import and port from C++ code. 2025-12-29 01:43:50 -07:00