pub struct Poseidon<F, Mds, const WIDTH: usize, const ALPHA: u64> { /* private fields */ }
Expand description
The Poseidon permutation.
Implementations§
Source§impl<F, Mds, const WIDTH: usize, const ALPHA: u64> Poseidon<F, Mds, WIDTH, ALPHA>where
F: PrimeField,
impl<F, Mds, const WIDTH: usize, const ALPHA: u64> Poseidon<F, Mds, WIDTH, ALPHA>where
F: PrimeField,
Sourcepub fn new(
half_num_full_rounds: usize,
num_partial_rounds: usize,
constants: Vec<F>,
mds: Mds,
) -> Self
pub fn new( half_num_full_rounds: usize, num_partial_rounds: usize, constants: Vec<F>, mds: Mds, ) -> Self
Create a new Poseidon configuration.
§Panics
Number of constants must match WIDTH times num_rounds
; panics otherwise.
pub fn new_from_rng<R: Rng>(
half_num_full_rounds: usize,
num_partial_rounds: usize,
mds: Mds,
rng: &mut R,
) -> Selfwhere
Standard: Distribution<F>,
Trait Implementations§
Source§impl<F: Clone, Mds: Clone, const WIDTH: usize, const ALPHA: u64> Clone for Poseidon<F, Mds, WIDTH, ALPHA>
impl<F: Clone, Mds: Clone, const WIDTH: usize, const ALPHA: u64> Clone for Poseidon<F, Mds, WIDTH, ALPHA>
Source§impl<F: Debug, Mds: Debug, const WIDTH: usize, const ALPHA: u64> Debug for Poseidon<F, Mds, WIDTH, ALPHA>
impl<F: Debug, Mds: Debug, const WIDTH: usize, const ALPHA: u64> Debug for Poseidon<F, Mds, WIDTH, ALPHA>
Source§impl<AF, Mds, const WIDTH: usize, const ALPHA: u64> Permutation<[AF; WIDTH]> for Poseidon<AF::F, Mds, WIDTH, ALPHA>
impl<AF, Mds, const WIDTH: usize, const ALPHA: u64> Permutation<[AF; WIDTH]> for Poseidon<AF::F, Mds, WIDTH, ALPHA>
fn permute_mut(&self, state: &mut [AF; WIDTH])
fn permute(&self, input: T) -> T
impl<AF, Mds, const WIDTH: usize, const ALPHA: u64> CryptographicPermutation<[AF; WIDTH]> for Poseidon<AF::F, Mds, WIDTH, ALPHA>
Auto Trait Implementations§
impl<F, Mds, const WIDTH: usize, const ALPHA: u64> Freeze for Poseidon<F, Mds, WIDTH, ALPHA>where
Mds: Freeze,
impl<F, Mds, const WIDTH: usize, const ALPHA: u64> RefUnwindSafe for Poseidon<F, Mds, WIDTH, ALPHA>where
Mds: RefUnwindSafe,
F: RefUnwindSafe,
impl<F, Mds, const WIDTH: usize, const ALPHA: u64> Send for Poseidon<F, Mds, WIDTH, ALPHA>
impl<F, Mds, const WIDTH: usize, const ALPHA: u64> Sync for Poseidon<F, Mds, WIDTH, ALPHA>
impl<F, Mds, const WIDTH: usize, const ALPHA: u64> Unpin for Poseidon<F, Mds, WIDTH, ALPHA>
impl<F, Mds, const WIDTH: usize, const ALPHA: u64> UnwindSafe for Poseidon<F, Mds, WIDTH, ALPHA>where
Mds: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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