Struct cryptoxide::blake2b::Blake2b
source · pub struct Blake2b { /* private fields */ }
Expand description
Blake2b Context
Implementations§
source§impl Blake2b
impl Blake2b
sourcepub fn new(outlen: usize) -> Self
pub fn new(outlen: usize) -> Self
Create a new Blake2b context with a specific output size in bytes
the size need to be between 0 (non included) and 64 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
pub fn reset_with_key(&mut self, key: &[u8])
pub fn blake2b(out: &mut [u8], input: &[u8], key: &[u8])
Trait Implementations§
source§impl Digest for Blake2b
impl Digest for Blake2b
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 Blake2b
impl Mac for Blake2b
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.