Struct cryptoxide::blake2b::Blake2b

source ·
pub struct Blake2b { /* private fields */ }
Expand description

Blake2b Context

Implementations§

source§

impl Blake2b

source

pub fn new(outlen: usize) -> Self

Create a new Blake2b context with a specific output size in bytes

the size need to be between 0 (non included) and 64 bytes (included)

source

pub fn new_keyed(outlen: usize, key: &[u8]) -> Self

Similar to new but also takes a variable size key to tweak the context initialization

source

pub fn reset(&mut self)

Reset the context to the state after calling new

source

pub fn reset_with_key(&mut self, key: &[u8])

source

pub fn blake2b(out: &mut [u8], input: &[u8], key: &[u8])

Trait Implementations§

source§

impl Clone for Blake2b

source§

fn clone(&self) -> Blake2b

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Digest for Blake2b

source§

fn input(&mut self, msg: &[u8])

Append message data in the digest state. Read more
source§

fn reset(&mut self)

Reset the digest. This method must be called after result() and before supplying more data.
source§

fn result(&mut self, out: &mut [u8])

Retrieve the digest result. This method may be called multiple times. Read more
source§

fn output_bits(&self) -> usize

Get the output size in bits.
source§

fn block_size(&self) -> usize

Get the block size in bytes.
source§

fn output_bytes(&self) -> usize

Get the output size in bytes.
source§

fn input_str(&mut self, input: &str)

Convenience function that feeds a string into a digest. Read more
source§

fn result_str(&mut self) -> String

Convenience function that retrieves the result of a digest as a String in hexadecimal format.
source§

impl Mac for Blake2b

source§

fn input(&mut self, data: &[u8])

Process input data. Read more
source§

fn reset(&mut self)

Reset the Mac state to begin processing another input stream.
source§

fn result(&mut self) -> MacResult

Obtain the result of a Mac computation as a MacResult.
source§

fn raw_result(&mut self, output: &mut [u8])

Obtain the result of a Mac computation as u8. This method should be used very carefully since incorrect use of the Mac code could result in permitting a timing attack which defeats the security provided by a Mac function.
source§

fn output_bytes(&self) -> usize

Get the size of the Mac code, in bytes.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.