Struct crypto::hashes::ternary::curl_p::CurlP [−][src]
pub struct CurlP { /* fields omitted */ }
ternary_hashes
and curl-p
only.State of the ternary cryptographic function CurlP
.
Implementations
impl CurlP
[src]
impl CurlP
[src]pub fn new() -> Self
[src]
Create a new CurlP
.
pub fn reset(&mut self)
[src]
Resets the internal state by overwriting it with zeros.
pub fn absorb(&mut self, input: &Trits)
[src]
Absorbs 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.
pub fn squeeze_into(&mut self, buf: &mut Trits)
[src]
Squeezes 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.
pub fn squeeze(&mut self) -> TritBuf
[src]
Convenience function using squeeze_into
to return an owned output.
pub fn digest_into(&mut self, input: &Trits, buf: &mut Trits)
[src]
Convenience function to absorb input
, squeeze the sponge into buf
, and reset the sponge.
pub fn digest(&mut self, input: &Trits) -> TritBuf
[src]
Convenience function to absorb input
, squeeze the sponge, reset the sponge and return an owned output.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CurlP
impl RefUnwindSafe for CurlP
impl UnwindSafe for CurlP
impl UnwindSafe for CurlP