[][src]Struct blake2b_simd::blake2bp::Params

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();

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 State
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

impl Clone for Params[src]

impl Debug for Params[src]

impl Default for Params[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.