pub enum Mode<'a> {
Plain,
Keyed(&'a [u8; 32]),
DeriveKey(&'a str),
DeriveKeyWith(&'a [u8; 32]),
}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; DeriveKeyWith takes it hashed
once for many calls).
§Trait implementations
Clonepreserves the function selected and any borrowed key or context.Copycopies the selection without copying the bytes it borrows.
Variants§
Plain
The plain 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.
DeriveKeyWith(&'a [u8; 32])
The key derivation function with its context string already hashed
(context_key); 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