Struct snarkvm_wasm::algorithms::Poseidon
pub struct Poseidon<E, const RATE: usize>where
E: Environment,{ /* private fields */ }
Implementations
impl<E, const RATE: usize> Poseidon<E, RATE>where
E: Environment,
impl<E, const RATE: usize> Poseidon<E, RATE>where
E: Environment,
pub fn setup(domain: &str) -> Result<Poseidon<E, RATE>, Error>
pub fn setup(domain: &str) -> Result<Poseidon<E, RATE>, Error>
Initializes a new instance of Poseidon.
pub fn parameters(
&self
) -> &Arc<PoseidonParameters<<E as Environment>::Field, RATE, _>>
pub fn parameters(
&self
) -> &Arc<PoseidonParameters<<E as Environment>::Field, RATE, _>>
Returns the Poseidon parameters for hashing.
Trait Implementations
impl<E, const RATE: usize> Clone for Poseidon<E, RATE>where
E: Clone + Environment,
<E as Environment>::Field: Clone,
impl<E, const RATE: usize> Clone for Poseidon<E, RATE>where
E: Clone + Environment,
<E as Environment>::Field: Clone,
impl<E, const RATE: usize> Hash for Poseidon<E, RATE>where
E: Environment,
impl<E, const RATE: usize> Hash for Poseidon<E, RATE>where
E: Environment,
impl<E, const RATE: usize> HashMany for Poseidon<E, RATE>where
E: Environment,
impl<E, const RATE: usize> HashMany for Poseidon<E, RATE>where
E: Environment,
fn hash_many(
&self,
input: &[<Poseidon<E, RATE> as HashMany>::Input],
num_outputs: u16
) -> Vec<<Poseidon<E, RATE> as HashMany>::Output, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn hash_many(
&self,
input: &[<Poseidon<E, RATE> as HashMany>::Input],
num_outputs: u16
) -> Vec<<Poseidon<E, RATE> as HashMany>::Output, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Returns the cryptographic hash for a list of field elements as input, and returns the specified number of field elements as output.
type Input = Field<E>
type Output = Field<E>
impl<E, const RATE: usize> HashToGroup for Poseidon<E, RATE>where
E: Environment,
impl<E, const RATE: usize> HashToGroup for Poseidon<E, RATE>where
E: Environment,
fn hash_to_group(
&self,
input: &[<Poseidon<E, RATE> as HashToGroup>::Input]
) -> Result<<Poseidon<E, RATE> as HashToGroup>::Output, Error>
fn hash_to_group(
&self,
input: &[<Poseidon<E, RATE> as HashToGroup>::Input]
) -> Result<<Poseidon<E, RATE> as HashToGroup>::Output, Error>
Returns a group element from hashing the input.
type Input = Field<E>
type Output = Group<E>
impl<E, const RATE: usize> HashToScalar for Poseidon<E, RATE>where
E: Environment,
impl<E, const RATE: usize> HashToScalar for Poseidon<E, RATE>where
E: Environment,
fn hash_to_scalar(
&self,
input: &[<Poseidon<E, RATE> as HashToScalar>::Input]
) -> Result<<Poseidon<E, RATE> as HashToScalar>::Output, Error>
fn hash_to_scalar(
&self,
input: &[<Poseidon<E, RATE> as HashToScalar>::Input]
) -> Result<<Poseidon<E, RATE> as HashToScalar>::Output, Error>
Returns a scalar from hashing the input. This method uses truncation (up to data bits) to project onto the scalar field.
type Input = Field<E>
type Output = Scalar<E>
impl<E, const RATE: usize> LeafHash for Poseidon<E, RATE>where
E: Environment,
impl<E, const RATE: usize> LeafHash for Poseidon<E, RATE>where
E: Environment,
impl<E, const RATE: usize> PRF for Poseidon<E, RATE>where
E: Environment,
impl<E, const RATE: usize> PRF for Poseidon<E, RATE>where
E: Environment,
impl<E, const RATE: usize> PathHash for Poseidon<E, RATE>where
E: Environment,
impl<E, const RATE: usize> PathHash for Poseidon<E, RATE>where
E: Environment,
fn hash_children(
&self,
left: &<Poseidon<E, RATE> as PathHash>::Hash,
right: &<Poseidon<E, RATE> as PathHash>::Hash
) -> Result<<Poseidon<E, RATE> as PathHash>::Hash, Error>
fn hash_children(
&self,
left: &<Poseidon<E, RATE> as PathHash>::Hash,
right: &<Poseidon<E, RATE> as PathHash>::Hash
) -> Result<<Poseidon<E, RATE> as PathHash>::Hash, Error>
Returns the hash of the given child nodes.
type Hash = Field<E>
fn hash_empty(&self) -> Result<Self::Hash, Error>
fn hash_empty(&self) -> Result<Self::Hash, Error>
Returns the empty hash.
Auto Trait Implementations
impl<E, const RATE: usize> RefUnwindSafe for Poseidon<E, RATE>where
<E as Environment>::Field: RefUnwindSafe,
impl<E, const RATE: usize> Send for Poseidon<E, RATE>
impl<E, const RATE: usize> Sync for Poseidon<E, RATE>
impl<E, const RATE: usize> Unpin for Poseidon<E, RATE>where
<E as Environment>::Field: Unpin,
impl<E, const RATE: usize> UnwindSafe for Poseidon<E, RATE>where
<E as Environment>::Field: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T>where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;