[−][src]Struct iota_crypto_preview::CurlP
Methods
impl CurlP
[src]
pub fn new(rounds: usize) -> Self
[src]
Create a new CurlP
sponge with rounds
of iterations.
pub fn rounds(&self) -> usize
[src]
Return the number of rounds used in this CurlP
instacnce.
Trait Implementations
impl Sponge for CurlP
[src]
const IN_LEN: usize
[src]
const OUT_LEN: usize
[src]
type Error = Infallible
An error indicating a that a failure has occured during absorb
.
fn absorb(&mut self, input: &Trits) -> Result<(), Self::Error>
[src]
Absorb input
into the sponge by copying HASH_LEN
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_LEN
with the last chunk having n < HASH_LEN
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 reset(&mut self)
[src]
Reset the internal state by overwriting it with zeros.
fn squeeze_into(&mut self, buf: &mut Trits) -> Result<(), Self::Error>
[src]
Squeeze the sponge by copying the calculated hash into the provided buf
. This will fill
the buffer in chunks of HASH_LEN
at a time.
If the last chunk is smaller than HASH_LEN
, then only the fraction that fits is written
into it.
fn squeeze(&mut self) -> Result<TritBuf, Self::Error>
[src]
fn digest_into(
&mut self,
input: &Trits,
buf: &mut Trits
) -> Result<(), Self::Error>
[src]
&mut self,
input: &Trits,
buf: &mut Trits
) -> Result<(), Self::Error>
fn digest(&mut self, input: &Trits) -> Result<TritBuf, Self::Error>
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,