pub struct Blake2s { /* private fields */ }Expand description
Blake2s Context
Implementations§
Source§impl Blake2s
impl Blake2s
Sourcepub fn new(outlen: usize) -> Self
pub fn new(outlen: usize) -> Self
Create a new Blake2s context with a specific output size in bytes
the size need to be between 0 (non included) and 32 bytes (included)
Sourcepub fn new_keyed(outlen: usize, key: &[u8]) -> Self
pub fn new_keyed(outlen: usize, key: &[u8]) -> Self
Similar to new but also takes a variable size key
to tweak the context initialization
Sourcepub fn reset_with_key(&mut self, key: &[u8])
pub fn reset_with_key(&mut self, key: &[u8])
Reset the blake2 context with a key
Trait Implementations§
Source§impl Digest for Blake2s
impl Digest for Blake2s
Source§fn reset(&mut self)
fn reset(&mut self)
Reset the digest. This method must be called after result() and before supplying more
data.
Source§fn result(&mut self, out: &mut [u8])
fn result(&mut self, out: &mut [u8])
Retrieve the digest result. This method may be called multiple times. Read more
Source§fn output_bits(&self) -> usize
fn output_bits(&self) -> usize
Get the output size in bits.
Source§fn block_size(&self) -> usize
fn block_size(&self) -> usize
Get the block size in bytes.
Source§fn output_bytes(&self) -> usize
fn output_bytes(&self) -> usize
Get the output size in bytes.
Source§fn input_str(&mut self, input: &str)
fn input_str(&mut self, input: &str)
Convenience function that feeds a string into a digest. Read more
Source§fn result_str(&mut self) -> String
fn result_str(&mut self) -> String
Convenience function that retrieves the result of a digest as a
String in hexadecimal format.
Source§impl Mac for Blake2s
impl Mac for Blake2s
Source§fn raw_result(&mut self, output: &mut [u8])
fn raw_result(&mut self, output: &mut [u8])
Obtain the result of a Mac computation as u8. This method should be used very carefully
since incorrect use of the Mac code could result in permitting a timing attack which defeats
the security provided by a Mac function.
Source§fn output_bytes(&self) -> usize
fn output_bytes(&self) -> usize
Get the size of the Mac code, in bytes.
Auto Trait Implementations§
impl Freeze for Blake2s
impl RefUnwindSafe for Blake2s
impl Send for Blake2s
impl Sync for Blake2s
impl Unpin for Blake2s
impl UnsafeUnpin for Blake2s
impl UnwindSafe for Blake2s
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