pub struct VarBlake2b { /* private fields */ }Expand description
Blake2b instance with a variable output.
Implementations§
Source§impl VarBlake2b
impl VarBlake2b
Sourcepub fn new_keyed(key: &[u8], output_size: usize) -> VarBlake2b ⓘ
pub fn new_keyed(key: &[u8], output_size: usize) -> VarBlake2b ⓘ
Creates a new hashing context with a key.
WARNING! If you plan to use it for variable output MAC, then
make sure to compare codes in constant time! It can be done
for example by using subtle crate.
Sourcepub fn with_params(
key: &[u8],
salt: &[u8],
persona: &[u8],
output_size: usize,
) -> VarBlake2b ⓘ
pub fn with_params( key: &[u8], salt: &[u8], persona: &[u8], output_size: usize, ) -> VarBlake2b ⓘ
Creates a new hashing context with the full set of sequential-mode parameters.
Trait Implementations§
Source§impl BlockInput for VarBlake2b
impl BlockInput for VarBlake2b
Source§impl Clone for VarBlake2b
impl Clone for VarBlake2b
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VarBlake2b
impl Debug for VarBlake2b
Source§impl Default for VarBlake2b
impl Default for VarBlake2b
Source§impl Reset for VarBlake2b
impl Reset for VarBlake2b
Source§impl Update for VarBlake2b
impl Update for VarBlake2b
Source§impl VariableOutputDirty for VarBlake2b
impl VariableOutputDirty for VarBlake2b
Source§fn new(output_size: usize) -> Result<VarBlake2b, InvalidOutputSize>
fn new(output_size: usize) -> Result<VarBlake2b, InvalidOutputSize>
Create new hasher instance with the given output size. Read more
Source§fn output_size(&self) -> usize
fn output_size(&self) -> usize
Get output size of the hasher instance provided to the
new methodSource§impl Write for VarBlake2b
Available on crate feature std only.
impl Write for VarBlake2b
Available on crate feature
std only.Source§fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
fn write(&mut self, buf: &[u8]) -> Result<usize, Error>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<(), Error>
fn flush(&mut self) -> Result<(), Error>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations§
impl Freeze for VarBlake2b
impl RefUnwindSafe for VarBlake2b
impl Send for VarBlake2b
impl Sync for VarBlake2b
impl Unpin for VarBlake2b
impl UnsafeUnpin for VarBlake2b
impl UnwindSafe for VarBlake2b
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<D> VariableOutput for Dwhere
D: VariableOutputDirty + Reset,
impl<D> VariableOutput for Dwhere
D: VariableOutputDirty + Reset,
Source§fn new(output_size: usize) -> Result<D, InvalidOutputSize>
fn new(output_size: usize) -> Result<D, InvalidOutputSize>
Create new hasher instance with the given output size. Read more
Source§fn output_size(&self) -> usize
fn output_size(&self) -> usize
Get output size of the hasher instance provided to the
new methodSource§fn finalize_variable(self, f: impl FnOnce(&[u8]))
fn finalize_variable(self, f: impl FnOnce(&[u8]))
Retrieve result via closure and consume hasher. Read more
Source§fn finalize_variable_reset(&mut self, f: impl FnOnce(&[u8]))
fn finalize_variable_reset(&mut self, f: impl FnOnce(&[u8]))
Retrieve result via closure and reset the hasher state. Read more