Struct blake2b_simd::blake2bp::Params  [−][src]
pub struct Params { /* fields omitted */ }A parameter builder for BLAKE2bp, just like the Params type for
BLAKE2b.
This builder only supports configuring the hash length and a secret key. This matches the options provided by the reference implementation.
Example
use blake2b_simd::blake2bp; let mut state = blake2bp::Params::new().hash_length(32).to_state();
Implementations
impl Params[src]
impl Params[src]pub fn new() -> Self[src]
Equivalent to Params::default().
pub fn hash(&self, input: &[u8]) -> Hash[src]
Hash an input all at once with these parameters.
pub fn to_state(&self) -> Stateⓘ[src]
Construct a BLAKE2bp State object based on these parameters.
pub fn hash_length(&mut self, length: usize) -> &mut Self[src]
Set the length of the final hash, from 1 to OUTBYTES (64). Apart from controlling the
length of the final Hash, this is also associated data, and changing it will result in a
totally different hash.
pub fn key(&mut self, key: &[u8]) -> &mut Self[src]
Use a secret key, so that BLAKE2bp acts as a MAC. The maximum key length is KEYBYTES
(64). An empty key is equivalent to having no key at all.