Packages / rupm

hmac-tools 0.1.0

HMAC (RFC 2104) over SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512, std only

Install

cargo add hmac-tools --registry rupm

In Ruststudio: Packages, search for hmac-tools, Install.

Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-22.

Versions

README

# hmac-tools

HMAC (RFC 2104) over SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512, std only

Add it with `rupm add hmac-tools` (or `cargo add hmac-tools --registry rupm`).

Checked against the RFC 4231 and RFC 2202 test vectors. This is a plain, unaudited implementation (the hashes are not constant-time), so it is not meant for security-critical use; use an audited crate there.

```rust
use hmac_tools::{hmac_hex, Algorithm};
let mac = hmac_hex(Algorithm::Sha256, b"Jefe", b"what do ya want for nothing?");
assert_eq!(mac, "5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843");
assert!(hmac_tools::verify_hex(Algorithm::Sha256, b"Jefe", b"what do ya want for nothing?", &mac));
```