pub struct Poly<T: Field, const N: usize>(/* private fields */);Implementations§
Source§impl Poly<DilithiumFq, DILITHIUM_N>
impl Poly<DilithiumFq, DILITHIUM_N>
pub fn new_random<R: RngCore + CryptoRng>(rng: &mut R) -> Self
pub fn into_array(self) -> [<<Self as Polynomial>::F as Field>::E; 256]
Source§impl Poly<KyberFq, { KYBER_N / 2 }>
impl Poly<KyberFq, { KYBER_N / 2 }>
pub fn serialize(&self, bytes: &mut [u8; 384])
pub fn deserialize(&mut self, bytes: &[u8])
pub fn cbd2(&mut self, buf: &[u8; 128])
pub fn cbd3(&mut self, buf: &[u8; 192])
pub fn getnoise_eta1<const K: usize>( &mut self, prf: &mut Prf, seed: &[u8; 32], nonce: u8, )
pub fn getnoise_eta2(&mut self, prf: &mut Prf, seed: &[u8; 32], nonce: u8)
pub fn ntt_and_reduce(&mut self)
pub fn into_array(self) -> [<KyberFq as Field>::E; 256]
pub fn compress_slice<const D: usize>(&self, ct: &mut [u8])
pub fn decompress_slice<const D: usize>(&mut self, ct: &[u8])
pub fn compress<const D: usize>(&self, ct: &mut [[u8; D]; 32])
pub fn decompress<const D: usize>(&mut self, ct: &[[u8; D]; 32])
pub fn set_from_message(&mut self, msg: &[u8; 32])
pub fn from_message(msg: &[u8; 32]) -> Self
pub fn compress_to_message(&self, msg: &mut [u8; 32])
Sourcepub fn scale_mont(&mut self)
pub fn scale_mont(&mut self)
Inplace conversion of all coefficients of a polynomial from normal domain to Montgomery domain
§Arguments
r- Input/output polynomial
Trait Implementations§
Source§impl<T: Field, const N: usize> AddAssign<&Poly<T, N>> for Poly<T, N>
Adds rhs polynomial to self; no modular reduction is performed.
impl<T: Field, const N: usize> AddAssign<&Poly<T, N>> for Poly<T, N>
Adds rhs polynomial to self; no modular reduction is performed.
§Arguments
rhs- Righthand-side input polynomial
Source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
Performs the
+= operation. Read moreSource§impl<'a, F: Field, const N: usize> IntoIterator for &'a Poly<F, N>
impl<'a, F: Field, const N: usize> IntoIterator for &'a Poly<F, N>
Source§impl<'a, F: Field, const N: usize> IntoIterator for &'a mut Poly<F, N>
impl<'a, F: Field, const N: usize> IntoIterator for &'a mut Poly<F, N>
Source§impl<T: PartialEq + Field, const N: usize> PartialEq for Poly<T, N>
impl<T: PartialEq + Field, const N: usize> PartialEq for Poly<T, N>
Source§impl<T: Field, const N: usize> SubAssign<&Poly<T, N>> for Poly<T, N>
Subtracts rhs polynomial from self, i.e. self <- self - rhs ; no modular reduction is performed.
impl<T: Field, const N: usize> SubAssign<&Poly<T, N>> for Poly<T, N>
Subtracts rhs polynomial from self, i.e. self <- self - rhs ; no modular reduction is performed.
§Arguments
rhs- Righthand-side input polynomial
Source§fn sub_assign(&mut self, rhs: &Self)
fn sub_assign(&mut self, rhs: &Self)
Performs the
-= operation. Read moreimpl<T: Copy + Field, const N: usize> Copy for Poly<T, N>
impl<T: Field, const N: usize> StructuralPartialEq for Poly<T, N>
Auto Trait Implementations§
impl<T, const N: usize> Freeze for Poly<T, N>where
T: Freeze,
impl<T, const N: usize> RefUnwindSafe for Poly<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for Poly<T, N>where
T: Send,
impl<T, const N: usize> Sync for Poly<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for Poly<T, N>where
T: Unpin,
impl<T, const N: usize> UnsafeUnpin for Poly<T, N>where
T: UnsafeUnpin,
impl<T, const N: usize> UnwindSafe for Poly<T, N>where
T: 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