Files
emsha-rs/Cargo.toml
T
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

12 lines
311 B
TOML

[package]
name = "emsha"
description = "embedded secure hashing"
repository = "https://git.wntrmute.dev/wntrmute/emsha-rs"
categories = ["cryptography", "no-std", "embedded"]
keywords = ["sha256", "hmac", "hash", "embedded", "no_std"]
license-file = "LICENSE"
version = "1.0.4"
edition = "2024"
[dependencies]