Struct snarkvm_algorithms::crypto_hash::poseidon::PoseidonSponge
source · [−]pub struct PoseidonSponge<F: PrimeField, const RATE: usize, const CAPACITY: usize> {
pub parameters: Arc<PoseidonParameters<F, RATE, CAPACITY>>,
pub state: State<F, RATE, CAPACITY>,
pub mode: DuplexSpongeMode,
}
Expand description
A duplex sponge based using the Poseidon permutation.
This implementation of Poseidon is entirely from Fractal’s implementation in COS20 with small syntax changes.
Fields
parameters: Arc<PoseidonParameters<F, RATE, CAPACITY>>
state: State<F, RATE, CAPACITY>
current sponge’s state (current elements in the permutation block)
mode: DuplexSpongeMode
current mode (whether its absorbing or squeezing)
Implementations
sourceimpl<F: PoseidonDefaultParametersField, const RATE: usize> PoseidonSponge<F, RATE, 1>
impl<F: PoseidonDefaultParametersField, const RATE: usize> PoseidonSponge<F, RATE, 1>
pub fn sample_default_parameters() -> Arc<PoseidonParameters<F, RATE, 1>>
pub fn with_default_parameters() -> Self
Trait Implementations
sourceimpl<F: PoseidonDefaultParametersField, const RATE: usize, const CAPACITY: usize> AlgebraicSponge<F, RATE, CAPACITY> for PoseidonSponge<F, RATE, CAPACITY>
impl<F: PoseidonDefaultParametersField, const RATE: usize, const CAPACITY: usize> AlgebraicSponge<F, RATE, CAPACITY> for PoseidonSponge<F, RATE, CAPACITY>
type Parameters = Arc<PoseidonParameters<F, RATE, CAPACITY>>
type Parameters = Arc<PoseidonParameters<F, RATE, CAPACITY>>
Parameters used by the sponge.
sourcefn with_parameters(parameters: &Self::Parameters) -> Self
fn with_parameters(parameters: &Self::Parameters) -> Self
Initialize a new instance of the sponge.
sourceimpl<F: Clone + PrimeField, const RATE: usize, const CAPACITY: usize> Clone for PoseidonSponge<F, RATE, CAPACITY>
impl<F: Clone + PrimeField, const RATE: usize, const CAPACITY: usize> Clone for PoseidonSponge<F, RATE, CAPACITY>
sourcefn clone(&self) -> PoseidonSponge<F, RATE, CAPACITY>
fn clone(&self) -> PoseidonSponge<F, RATE, CAPACITY>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<F: Debug + PrimeField, const RATE: usize, const CAPACITY: usize> Debug for PoseidonSponge<F, RATE, CAPACITY>
impl<F: Debug + PrimeField, const RATE: usize, const CAPACITY: usize> Debug for PoseidonSponge<F, RATE, CAPACITY>
sourceimpl<F: PoseidonDefaultParametersField, const RATE: usize> DefaultCapacityAlgebraicSponge<F, RATE> for PoseidonSponge<F, RATE, 1>
impl<F: PoseidonDefaultParametersField, const RATE: usize> DefaultCapacityAlgebraicSponge<F, RATE> for PoseidonSponge<F, RATE, 1>
fn sample_parameters() -> Arc<PoseidonParameters<F, RATE, 1>>
fn with_default_parameters() -> Self
Auto Trait Implementations
impl<F, const RATE: usize, const CAPACITY: usize> RefUnwindSafe for PoseidonSponge<F, RATE, CAPACITY> where
F: RefUnwindSafe,
impl<F, const RATE: usize, const CAPACITY: usize> Send for PoseidonSponge<F, RATE, CAPACITY>
impl<F, const RATE: usize, const CAPACITY: usize> Sync for PoseidonSponge<F, RATE, CAPACITY>
impl<F, const RATE: usize, const CAPACITY: usize> Unpin for PoseidonSponge<F, RATE, CAPACITY> where
F: Unpin,
impl<F, const RATE: usize, const CAPACITY: usize> UnwindSafe for PoseidonSponge<F, RATE, CAPACITY> where
F: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more