pub enum Mode<'a> {
Hash,
Keyed(&'a [u8; 32]),
DeriveKey(&'a str),
DeriveKeyMaterial(&'a ContextKey),
}Expand description
Which of BLAKE3’s three functions a call computes: the plain hash
(hash), the keyed hash, or key derivation. Every call that takes a mode runs each one at the same
speed, but for DeriveKey, which first hashes its context string (once
per call; DeriveKeyMaterial takes it hashed
once for many calls).
Variants§
Hash
The default hash function, as hash.
Keyed(&'a [u8; 32])
The keyed hash function with this key.
DeriveKey(&'a str)
The key derivation function with this context string; the input is the key material.
DeriveKeyMaterial(&'a ContextKey)
The key derivation function with its context string already hashed
(hash_derive_key_context); the input is the key material.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Mode<'a>
impl<'a> RefUnwindSafe for Mode<'a>
impl<'a> Send for Mode<'a>
impl<'a> Sync for Mode<'a>
impl<'a> Unpin for Mode<'a>
impl<'a> UnsafeUnpin for Mode<'a>
impl<'a> UnwindSafe for Mode<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more