pub struct FullRoundConstants<F, const WIDTH: usize> {
pub initial: Vec<[F; WIDTH]>,
pub terminal: Vec<[F; WIDTH]>,
pub dense_mds: [[F; WIDTH]; WIDTH],
}Expand description
Pre-computed constants for the full (external) rounds.
The full rounds are split equally: half before the partial rounds (initial), and half after (terminal).
The MDS matrix is not stored here. It is dispatched through a permutation trait at the call site. This allows concrete fields to use optimized implementations (e.g., Karatsuba convolution) while generic algebra types fall back to dense O(t^2) multiplication.
Fields§
§initial: Vec<[F; WIDTH]>Round constants for the initial full rounds.
terminal: Vec<[F; WIDTH]>Round constants for the terminal full rounds.
dense_mds: [[F; WIDTH]; WIDTH]Dense N x N MDS matrix expanded from the circulant first column.
The scalar MDS path uses a Karatsuba convolution with i64 intermediates.
That approach relies on bit-shifts for halving.
Packed SIMD types cannot perform bit-shifts. They only support field arithmetic.
Storing the fully expanded matrix lets SIMD implementations either:
- Fall back to dense O(t^2) multiplication over
Algebra<F>. - Extract the first column for a field-level Karatsuba that uses
halve()instead of bit-shifts.
Trait Implementations§
Source§impl<F: Clone, const WIDTH: usize> Clone for FullRoundConstants<F, WIDTH>
impl<F: Clone, const WIDTH: usize> Clone for FullRoundConstants<F, WIDTH>
Source§fn clone(&self) -> FullRoundConstants<F, WIDTH>
fn clone(&self) -> FullRoundConstants<F, WIDTH>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<F, const WIDTH: usize> Freeze for FullRoundConstants<F, WIDTH>where
F: Freeze,
impl<F, const WIDTH: usize> RefUnwindSafe for FullRoundConstants<F, WIDTH>where
F: RefUnwindSafe,
impl<F, const WIDTH: usize> Send for FullRoundConstants<F, WIDTH>where
F: Send,
impl<F, const WIDTH: usize> Sync for FullRoundConstants<F, WIDTH>where
F: Sync,
impl<F, const WIDTH: usize> Unpin for FullRoundConstants<F, WIDTH>where
F: Unpin,
impl<F, const WIDTH: usize> UnsafeUnpin for FullRoundConstants<F, WIDTH>where
F: UnsafeUnpin,
impl<F, const WIDTH: usize> UnwindSafe for FullRoundConstants<F, WIDTH>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
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>
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>
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