pub struct Blake2s { /* private fields */ }
Expand description
Blake2b Context
Implementations
impl Blake2s
impl Blake2s
pub fn new(outlen: usize) -> Blake2s
pub fn new(outlen: usize) -> Blake2s
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)
pub fn new_keyed(outlen: usize, key: &[u8]) -> Blake2s
pub fn new_keyed(outlen: usize, key: &[u8]) -> Blake2s
Similar to new
but also takes a variable size key
to tweak the context initialization
pub fn reset(&mut self)
pub fn reset(&mut self)
Reset the context to the state after calling new
pub fn reset_with_key(&mut self, key: &[u8])
pub fn blake2s(out: &mut [u8], input: &[u8], key: &[u8])
Trait Implementations
impl Digest for Blake2s
impl Digest for Blake2s
pub fn reset(&mut self)
pub fn reset(&mut self)
Reset the digest. This method must be called after result() and before supplying more data. Read more
pub fn result(&mut self, out: &mut [u8])
pub fn result(&mut self, out: &mut [u8])
Retrieve the digest result. This method may be called multiple times. Read more
pub fn output_bits(&self) -> usize
pub fn output_bits(&self) -> usize
Get the output size in bits.
pub fn block_size(&self) -> usize
pub fn block_size(&self) -> usize
Get the block size in bytes.
fn output_bytes(&self) -> usize
fn output_bytes(&self) -> usize
Get the output size in bytes.
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
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. Read more
sourceimpl Hash for Blake2s
impl Hash for Blake2s
pub const HASH_LEN: usize
pub const BLOCK_LEN: usize
type HASH = [u8; 32]
type BLOCK = [u8; 64]
pub fn name() -> &'static str
pub fn zero_hash() -> <Blake2s as Hash>::HASH
pub fn zero_block() -> <Blake2s as Hash>::BLOCK
pub fn hasher() -> Blake2s
pub fn reset(&mut self)
pub fn input(&mut self, data: impl AsRef<[u8]>)
pub fn result(&mut self, output: &mut <Blake2s as Hash>::HASH)
impl Mac for Blake2s
impl Mac for Blake2s
pub fn reset(&mut self)
pub fn reset(&mut self)
Reset the Mac state to begin processing another input stream.
pub fn result(&mut self) -> MacResult
pub fn result(&mut self) -> MacResult
Obtain the result of a Mac computation as a MacResult
.
pub fn raw_result(&mut self, output: &mut [u8])
pub fn raw_result(&mut self, output: &mut [u8])
pub fn output_bytes(&self) -> usize
pub fn output_bytes(&self) -> usize
Get the size of the Mac code, in bytes.
Auto Trait Implementations
impl RefUnwindSafe for Blake2s
impl Send for Blake2s
impl Sync for Blake2s
impl Unpin for Blake2s
impl UnwindSafe for Blake2s
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more