Registry / crypto / crypto-mac

crypto-mac

JSON →
library0.11.1rscratesunverified

Provides the `Mac` trait for Message Authentication Code (MAC) algorithms, used by many RustCrypto implementations.

# Cargo.toml [dependencies] crypto-mac = "0.11.1"
INSTALL
IMPORT
SIG · CRYPTO-MAC
C
crypto-mac
cryptorustv0.11.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Mac
✓ use crypto_mac::Mac;

Compute HMAC-SHA256 using the Mac trait.

use crypto_mac::{Mac, NewMac}; use hmac::Hmac; use sha2::Sha256; let mut mac = Hmac::<Sha256>::new_from_slice(b"my key").unwrap(); mac.update(b"data"); let result = mac.finalize(); let code = result.into_bytes();
Debug
Known issues
breakingDeprecated in favor of `digest` crate's `Mac` trait
fix
Use `digest::Mac` from the `digest` crate instead
affects: >=0.11.0
Upgrade
Version history
0.11.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
16
Resources
crypto-mac — cargo add crypto-mac · libregistry