pub struct Blake3 { /* private fields */ }Expand description
BLAKE3 hash function.
Implements the Hasher trait. See the module documentation for
examples and backend details.
When the zeroize feature is enabled, the internal state (key words, chunk
buffer and chaining-value stack) is overwritten with zeros when the hasher is
dropped, so key material does not linger in memory.
Implementations§
Source§impl Blake3
impl Blake3
Sourcepub fn new_derive_key(context: &str) -> Self
pub fn new_derive_key(context: &str) -> Self
Create a key-derivation hasher from a context string.
The context string should be hardcoded, globally unique and
application-specific; see derive_key.
Sourcepub fn derive_key(context: &str, key_material: &[u8]) -> [u8; 32]
pub fn derive_key(context: &str, key_material: &[u8]) -> [u8; 32]
Derive a 32-byte subkey from key_material and a context string.
The context string should be hardcoded, globally unique and
application-specific, e.g. "example.com 2019-12-25 16:18:03 session tokens v1". This function is not a password hash.
Sourcepub fn finalize_xof(self) -> Blake3XofReader
pub fn finalize_xof(self) -> Blake3XofReader
Finalize the hasher and return an extendable-output reader.