pub struct Poseidon1InternalLayerTextbook<F, Mds, const WIDTH: usize> { /* private fields */ }Expand description
Textbook internal (partial round) layer for the Poseidon1 permutation.
Uses the MDS permutation per round with forward-substituted scalar constants.
Each partial round adds a single scalar to state[0], applies the S-box, and
multiplies by the MDS. After all rounds, a residual vector is added.
Use this instead of Poseidon1InternalLayerGeneric when the MDS permutation
is very fast (e.g., Karatsuba convolution for power-of-2 circulant matrices).
Trait Implementations§
Source§impl<F: Clone, Mds: Clone, const WIDTH: usize> Clone for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>
impl<F: Clone, Mds: Clone, const WIDTH: usize> Clone for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>
Source§fn clone(&self) -> Poseidon1InternalLayerTextbook<F, Mds, WIDTH>
fn clone(&self) -> Poseidon1InternalLayerTextbook<F, Mds, WIDTH>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<F: Debug, Mds: Debug, const WIDTH: usize> Debug for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>
impl<F: Debug, Mds: Debug, const WIDTH: usize> Debug for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>
Source§impl<F, A, Mds, const WIDTH: usize, const D: u64> PartialRoundLayer<A, WIDTH, D> for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>where
F: Field + InjectiveMonomial<D>,
A: Algebra<F> + InjectiveMonomial<D>,
Mds: Permutation<[A; WIDTH]> + Default + Sync + Clone,
impl<F, A, Mds, const WIDTH: usize, const D: u64> PartialRoundLayer<A, WIDTH, D> for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>where
F: Field + InjectiveMonomial<D>,
A: Algebra<F> + InjectiveMonomial<D>,
Mds: Permutation<[A; WIDTH]> + Default + Sync + Clone,
Source§fn permute_state(&self, state: &mut [A; WIDTH])
fn permute_state(&self, state: &mut [A; WIDTH])
Apply all RP partial rounds to the state.
Source§impl<F: Field, Mds, const WIDTH: usize> PartialRoundLayerConstructor<F, WIDTH> for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>
impl<F: Field, Mds, const WIDTH: usize> PartialRoundLayerConstructor<F, WIDTH> for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>
Source§fn new_from_constants(constants: PartialRoundConstants<F, WIDTH>) -> Self
fn new_from_constants(constants: PartialRoundConstants<F, WIDTH>) -> Self
Build the layer from the sparse-form optimized constants.
Auto Trait Implementations§
impl<F, Mds, const WIDTH: usize> Freeze for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>where
F: Freeze,
impl<F, Mds, const WIDTH: usize> RefUnwindSafe for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>where
Mds: RefUnwindSafe,
F: RefUnwindSafe,
impl<F, Mds, const WIDTH: usize> Send for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>
impl<F, Mds, const WIDTH: usize> Sync for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>
impl<F, Mds, const WIDTH: usize> Unpin for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>
impl<F, Mds, const WIDTH: usize> UnsafeUnpin for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>where
F: UnsafeUnpin,
impl<F, Mds, const WIDTH: usize> UnwindSafe for Poseidon1InternalLayerTextbook<F, Mds, WIDTH>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§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