Function iroh_blake3::keyed_hash

source ·
pub fn keyed_hash(key: &[u8; 32], input: &[u8]) -> Hash
Expand description

The keyed hash function.

This is suitable for use as a message authentication code, for example to replace an HMAC instance. In that use case, the constant-time equality checking provided by Hash is almost always a security requirement, and callers need to be careful not to compare MACs as raw bytes.

For output sizes other than 32 bytes, see Hasher::new_keyed, Hasher::finalize_xof, and OutputReader.

This function is always single-threaded. For multithreading support, see Hasher::new_keyed and Hasher::update_rayon.