pub struct Blake2b { /* private fields */ }Expand description
A BLAKE2b hasher with a caller-chosen output length.
Implementations§
Source§impl Blake2b
impl Blake2b
Sourcepub fn new(output_len: usize) -> Result<Self>
pub fn new(output_len: usize) -> Result<Self>
Create a hasher producing output_len bytes, between 1 and 64.
Sourcepub fn with_key(output_len: usize, key: &[u8]) -> Result<Self>
pub fn with_key(output_len: usize, key: &[u8]) -> Result<Self>
Create a keyed hasher, the BLAKE2b equivalent of an HMAC.
The key is absorbed as a zero-padded first block, exactly as RFC 7693 specifies, so a keyed hash of an empty message is still one compression.
Sourcepub fn update(&mut self, data: &[u8])
pub fn update(&mut self, data: &[u8])
Absorb more input.
BLAKE2b marks the last block specially, so a full buffer is only compressed once more input is known to follow.
Sourcepub fn finalize_into(self, out: &mut [u8]) -> Result<()>
pub fn finalize_into(self, out: &mut [u8]) -> Result<()>
Finish and write the digest into out, which must be output_len long.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Blake2b
impl RefUnwindSafe for Blake2b
impl Send for Blake2b
impl Sync for Blake2b
impl Unpin for Blake2b
impl UnsafeUnpin for Blake2b
impl UnwindSafe for Blake2b
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