[][src]Struct bee_crypto::ternary::sponge::CurlP

pub struct CurlP { /* fields omitted */ }

State of the ternary cryptographic function CurlP.

Implementations

impl CurlP[src]

pub fn new(rounds: CurlPRounds) -> Self[src]

Create a new CurlP sponge with rounds of iterations.

Trait Implementations

impl Sponge for CurlP[src]

type Error = Infallible

An error indicating that a failure has occured during a sponge operation.

fn reset(&mut self)[src]

Reset the internal state by overwriting it with zeros.

fn absorb(&mut self, input: &Trits) -> Result<(), Self::Error>[src]

Absorb input into the sponge by copying HASH_LENGTH chunks of it into its internal state and transforming the state before moving on to the next chunk.

If input is not a multiple of HASH_LENGTH with the last chunk having n < HASH_LENGTH trits, the last chunk will be copied to the first n slots of the internal state. The remaining data in the internal state is then just the result of the last transformation before the data was copied, and will be reused for the next transformation.

fn squeeze_into(&mut self, buf: &mut Trits) -> Result<(), Self::Error>[src]

Squeeze the sponge by copying the state into the provided buf. This will fill the buffer in chunks of HASH_LENGTH at a time.

If the last chunk is smaller than HASH_LENGTH, then only the fraction that fits is written into it.

Auto Trait Implementations

impl RefUnwindSafe for CurlP

impl Send for CurlP

impl Sync for CurlP

impl Unpin for CurlP

impl UnwindSafe for CurlP

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, U> Sponge for U where
    T: Sponge,
    U: DerefMut<Target = T>, 
[src]

type Error = <T as Sponge>::Error

An error indicating that a failure has occured during a sponge operation.

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.