Struct blake2b_simd::blake2bp::Params [−][src]
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]
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.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Params
impl Send for Params
impl Sync for Params
impl Unpin for Params
impl UnwindSafe for Params
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,