Skip to main content

PolyMat

Struct PolyMat 

Source
pub struct PolyMat<P, const N: usize, const K: usize, const L: usize>(/* private fields */)
where
    P: SizedPolynomial<N>;

Implementations§

Source§

impl<P, const N: usize, const K: usize, const L: usize> PolyMat<P, N, K, L>
where P: SizedPolynomial<N>,

Source

pub fn gen_matrix<const TRANSPOSED: bool>(seed: &[u8; 32]) -> Self

Expand seed to A matrix (or A^T if TRANSPOSED is true) For Kyber:

For dilithium: polyvec_matrix_expand TRANSPOSED = false

Source

pub fn gen_a(seed: &[u8; 32]) -> Self

Source

pub fn gen_at(seed: &[u8; 32]) -> Self

Source

pub fn gen_matrix_into<const TRANSPOSED: bool>(&mut self, seed: &[u8; 32])

Trait Implementations§

Source§

impl<P, const N: usize, const K: usize, const L: usize> AsMut<[PolyVec<P, N, L>; K]> for PolyMat<P, N, K, L>
where P: SizedPolynomial<N>,

Source§

fn as_mut(&mut self) -> &mut [PolyVec<P, N, L>; K]

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<P, const N: usize, const K: usize, const L: usize> AsRef<[PolyVec<P, N, L>; K]> for PolyMat<P, N, K, L>
where P: SizedPolynomial<N>,

Source§

fn as_ref(&self) -> &[PolyVec<P, N, L>; K]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<P, const N: usize, const K: usize, const L: usize> Debug for PolyMat<P, N, K, L>
where P: SizedPolynomial<N> + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P, const N: usize, const K: usize, const L: usize> Default for PolyMat<P, N, K, L>
where P: SizedPolynomial<N>,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<P, const N: usize, const K: usize, const L: usize> Index<usize> for PolyMat<P, N, K, L>
where P: SizedPolynomial<N>,

Source§

type Output = PolyVec<P, N, L>

The returned type after indexing.
Source§

fn index(&self, i: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<P, const N: usize, const K: usize, const L: usize> IndexMut<usize> for PolyMat<P, N, K, L>
where P: SizedPolynomial<N>,

Source§

fn index_mut(&mut self, i: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<P, const N: usize, const K: usize, const L: usize> Freeze for PolyMat<P, N, K, L>
where P: Freeze,

§

impl<P, const N: usize, const K: usize, const L: usize> RefUnwindSafe for PolyMat<P, N, K, L>
where P: RefUnwindSafe,

§

impl<P, const N: usize, const K: usize, const L: usize> Send for PolyMat<P, N, K, L>
where P: Send,

§

impl<P, const N: usize, const K: usize, const L: usize> Sync for PolyMat<P, N, K, L>
where P: Sync,

§

impl<P, const N: usize, const K: usize, const L: usize> Unpin for PolyMat<P, N, K, L>
where P: Unpin,

§

impl<P, const N: usize, const K: usize, const L: usize> UnsafeUnpin for PolyMat<P, N, K, L>
where P: UnsafeUnpin,

§

impl<P, const N: usize, const K: usize, const L: usize> UnwindSafe for PolyMat<P, N, K, L>
where P: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V