[−][src]Struct blake2s_simd::blake2sp::Params
A parameter builder for BLAKE2sp, just like the Params
type for
BLAKE2s.
This builder only supports configuring the hash length and a secret key. This matches the options provided by the reference implementation.
Example
use blake2s_simd::blake2sp; let mut state = blake2sp::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 BLAKE2sp 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 BLAKE2sp acts as a MAC. The maximum key length is KEYBYTES
(64). An empty key is equivalent to having no key at all.
Trait Implementations
impl Clone for Params
[src]
fn clone(&self) -> Params
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Params
[src]
impl Debug for Params
[src]
Auto Trait Implementations
impl Sync for Params
impl Unpin for Params
impl Send for Params
impl UnwindSafe for Params
impl RefUnwindSafe 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,