[−][src]Struct iota_crypto::Curl
The Curl struct is a Sponge that uses the Curl hashing algorithm.
use iota_crypto::{Sponge, Curl}; // Create an array of 243 1s let input = [1; 243]; // Create an array of 243 0s let mut out = [0; 243]; let mut curl = Curl::default(); curl.absorb(&input); curl.squeeze(&mut out);
Methods
impl Curl
[src]
pub fn new(mode: HashMode) -> Result<Curl, Error>
[src]
Creates a new instance of Curl using the provided mode
pub fn state(&self) -> &[i8]
[src]
Provides a view into the internal state
pub fn state_mut(&mut self) -> &mut [i8]
[src]
Provides a mutable view into the internal state
pub fn number_of_rounds(&self) -> usize
[src]
Trait Implementations
impl Sponge for Curl
[src]
fn absorb(&mut self, trits: &[i8]) -> Result<(), Error>
[src]
fn squeeze(&mut self, out: &mut [i8]) -> Result<(), Error>
[src]
fn reset(&mut self)
[src]
impl Copy for Curl
[src]
impl Clone for Curl
[src]
fn clone(&self) -> Curl
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Curl
[src]
impl Debug for Curl
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,