Expand description
§HMAC (Hash-based Message Authentication Code)
This module provides HMAC implementations using various hash functions. HMAC is a mechanism for message authentication using cryptographic hash functions.
§Features
- HMAC-SHA256, HMAC-SHA384, HMAC-SHA512 implementations
- RFC 2104 compliant
- Constant-time operations resistant to timing attacks
- Support for keys of any length
§Example
use crypto_async_rs::hmac;
let key = b"secret-key";
let message = b"Hello, World!";
// Compute HMAC-SHA256
let hmac_sha256 = hmac::hmac_sha256(key, message);
println!("HMAC-SHA256: {:02x?}", hmac_sha256);
// Compute HMAC-SHA512
let hmac_sha512 = hmac::hmac_sha512(key, message);
println!("HMAC-SHA512: {:02x?}", hmac_sha512);Functions§
- hmac
- hmac_
sha256 - Compute HMAC-SHA256
- hmac_
sha384 - Compute HMAC-SHA384
- hmac_
sha512 - Compute HMAC-SHA512