Struct xkcp_rs::KeccakHash

source ·
#[repr(align(8))]
pub struct KeccakHash { /* private fields */ }
Expand description

Keccak hash function instance.

Implementations§

source§

impl KeccakHash

source

pub fn new( rate: u32, capacity: u32, hash_bit_length: u32, suffix: u8 ) -> Result<Self>

Initialize the Keccak[r, c] sponge function instance used in sequential hashing mode.

source

pub fn shake128() -> Self

Initializes a SHAKE128 instance as specified in the FIPS 202 standard.

source

pub fn shake256() -> Self

Initializes a SHAKE256 instance as specified in the FIPS 202 standard.

source

pub fn sha3_224() -> Self

Initializes a SHA3-224 instance as specified in the FIPS 202 standard.

source

pub fn sha3_256() -> Self

Initializes a SHA3-256 instance as specified in the FIPS 202 standard.

source

pub fn sha3_384() -> Self

Initializes a SHA3-384 instance as specified in the FIPS 202 standard.

source

pub fn sha3_512() -> Self

Initializes a SHA3-512 instance as specified in the FIPS 202 standard.

source

pub fn keccak224() -> Self

Initializes a Keccak-224 instance.

source

pub fn keccak256() -> Self

Initializes a Keccak-256 instance.

source

pub fn keccak384() -> Self

Initializes a Keccak-384 instance.

source

pub fn keccak512() -> Self

Initializes a Keccak-512 instance.

source

pub fn update(&mut self, data: &[u8]) -> Result<()>

Absorbs input data.

source

pub fn finalize(&mut self, out: &mut [u8]) -> Result<()>

Function to call after all input blocks have been input and to get output bits if the length was specified.

source

pub fn squeeze(&mut self, data: &mut [u8]) -> Result<()>

Squeezes output data.

Trait Implementations§

source§

impl Clone for KeccakHash

source§

fn clone(&self) -> Self

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 Debug for KeccakHash

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

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.
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.
source§

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

Performs the conversion.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 224 bytes