pub struct Poseidon2<F: PrimeField>(/* private fields */);
Expand description
A Poseidon2 permutation family https://eprint.iacr.org/2023/323
Implementations§
Source§impl<F: PrimeField> Poseidon2<F>
impl<F: PrimeField> Poseidon2<F>
Sourcepub fn permute<P, const T: usize>(input: &[F; T]) -> [F; T]where
P: Poseidon2Params<F, T>,
pub fn permute<P, const T: usize>(input: &[F; T]) -> [F; T]where
P: Poseidon2Params<F, T>,
Apply Poseidon2 permutation on input
and return the permuted result
Sourcepub fn permute_mut<P, const T: usize>(input: &mut [F; T])where
P: Poseidon2Params<F, T>,
pub fn permute_mut<P, const T: usize>(input: &mut [F; T])where
P: Poseidon2Params<F, T>,
Apply Poseidon2 permutation on input
in place
Auto Trait Implementations§
impl<F> Freeze for Poseidon2<F>
impl<F> RefUnwindSafe for Poseidon2<F>where
F: RefUnwindSafe,
impl<F> Send for Poseidon2<F>
impl<F> Sync for Poseidon2<F>
impl<F> Unpin for Poseidon2<F>where
F: Unpin,
impl<F> UnwindSafe for Poseidon2<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more