Packages / rupm

rs-crypto-hmac 0.1.0

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

Install

cargo add rs-crypto-hmac --registry rupm

In Ruststudio: Packages, search for rs-crypto-hmac, Install.

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

Versions

README

# rs-crypto-hmac

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

Add it with `rupm add rs-crypto-hmac` (or `cargo add rs-crypto-hmac --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 rs_crypto_hmac::{hmac_hex, Algorithm};
let mac = hmac_hex(Algorithm::Sha256, b"Jefe", b"what do ya want for nothing?");
assert_eq!(mac, "5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843");
assert!(rs_crypto_hmac::verify_hex(Algorithm::Sha256, b"Jefe", b"what do ya want for nothing?", &mac));
```