[][src]Struct rcrypto::Keccak

pub struct Keccak { /* fields omitted */ }

Implementations

impl Keccak[src]

pub fn new(b: usize, nr: u32) -> Result<Keccak, CryptoError>[src]

KECCAK-p[b,nr]
b means that the width of the permutation;
nr means that the number of rounds;

pub fn keccak_25(nr: u32) -> Self[src]

pub fn keccak_50(nr: u32) -> Self[src]

pub fn keccak_100(nr: u32) -> Self[src]

pub fn keccak_200(nr: u32) -> Self[src]

pub fn keccak_400(nr: u32) -> Self[src]

pub fn keccak_800(nr: u32) -> Self[src]

pub fn keccak_1600(nr: u32) -> Self[src]

pub fn widths(&self) -> usize[src]

the permutation widths

pub fn permutation(
    &mut self,
    byte_data: &[u8],
    results: &mut Vec<u8>
) -> Result<usize, CryptoError>
[src]

perform the KECCAK-p[b,nr] permutation, the byte_data.len() must be greater than or equal to (self.widths() + 7) / 8. The extra bits will be discarded when the byte_data.len() greater than the (self.widths() + 7) / 8, the bits processed from left to right in writing order and return the bit lengths of the results if success.;

pub fn sponge(&self, rate: usize) -> Result<KeccakSponge, CryptoError>[src]

Sponge[Keccak-p[b,nr], pad10*1, rate]
rate must be a positive integer and strictly less than the width self.widths().

Trait Implementations

impl Clone for Keccak[src]

Auto Trait Implementations

impl RefUnwindSafe for Keccak

impl Send for Keccak

impl Sync for Keccak

impl Unpin for Keccak

impl UnwindSafe for Keccak

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.