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