Skip to main content

PolyVec

Struct PolyVec 

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

Implementations§

Source§

impl<const N: usize, const K: usize> PolyVec<KyberPoly, N, K>

Source

pub fn new_deserialize(bytes: &[[u8; 384]; K]) -> Self

Source

pub fn deserialize(&mut self, bytes: &[[u8; 384]; K])

Source

pub fn serialize(&self, r: &mut [[u8; 384]; K])

Source§

impl<const K: usize> PolyVec<Poly<KyberFq, { KYBER_N / 2 }>, { KyberPoly::N }, K>

Source

pub fn getnoise_eta1(&mut self, prf: &mut Prf, seed: &[u8; 32], nonce: u8)

Source

pub fn getnoise_eta2(&mut self, prf: &mut Prf, seed: &[u8; 32], nonce: u8)

Source

pub fn compress<const D: usize>(&self, ct: &mut [[[u8; D]; 32]; K])

Source

pub fn decompress<const D: usize>(&mut self, ct: &[[[u8; D]; 32]; K])

Source§

impl<const K: usize> PolyVec<Poly<DilithiumFq, DILITHIUM_N>, { DilithiumPoly::N }, K>

Source

pub fn new_random<R: RngCore + CryptoRng>(rng: &mut R) -> Self

Trait Implementations§

Source§

impl<P, const N: usize, const K: usize> AddAssign<&PolyVec<P, N, K>> for PolyVec<P, N, K>
where P: Polynomial,

Source§

fn add_assign(&mut self, rhs: &Self)

Performs the += operation. Read more
Source§

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

Source§

fn as_mut(&mut self) -> &mut [P; K]

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

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

Source§

fn as_ref(&self) -> &[P; K]

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

impl<P, const N: usize, const K: usize> Clone for PolyVec<P, N, K>
where P: Polynomial + Clone,

Source§

fn clone(&self) -> PolyVec<P, N, K>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P, const N: usize, const K: usize> Debug for PolyVec<P, N, K>
where P: Polynomial + 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> Default for PolyVec<P, N, K>
where P: Polynomial,

Source§

fn default() -> Self

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

impl<P, const N: usize, const K: usize> Index<usize> for PolyVec<P, N, K>
where P: Polynomial,

Source§

type Output = P

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> IndexMut<usize> for PolyVec<P, N, K>
where P: Polynomial,

Source§

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

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

impl<'a, P, const N: usize, const K: usize> IntoIterator for &'a PolyVec<P, N, K>
where P: Polynomial,

Source§

type Item = &'a P

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, P>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, const N: usize, P, const K: usize> IntoIterator for &'a mut PolyVec<P, N, K>
where P: Polynomial,

Source§

type Item = &'a mut P

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, P>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<P, const N: usize, const K: usize> PolynomialVector for PolyVec<P, N, K>
where P: SizedPolynomial<N>,

Source§

const K: usize = K

Source§

type Poly = P

Source§

fn ntt(&mut self)

Source§

fn ntt_and_reduce(&mut self)

Source§

fn inv_ntt_tomont(&mut self)

Source§

fn reduce(&mut self)

Source§

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

Source§

fn basemul_acc( &self, other: &Self, result: &mut <Self as PolynomialVector>::Poly, )

Source§

impl<P, const N: usize, const K: usize> Copy for PolyVec<P, N, K>
where P: Polynomial + Copy,

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<P, const N: usize, const K: usize> UnwindSafe for PolyVec<P, N, K>
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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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