pub struct Polynomial {
pub coeffs: [i16; 256],
}Expand description
A polynomial over the ML-KEM ring. Note: this is exposed publicly only for testing purposes and there is no good reason to use it in production code.
Fields§
§coeffs: [i16; 256]Note: this is exposed publicly only for testing purposes and there is no good reason to use it in production code.
Implementations§
Source§impl Polynomial
impl Polynomial
Sourcepub fn ntt(&mut self)
pub fn ntt(&mut self)
Algorithm 9 NTT(𝑓) Computes the NTT representation 𝑓_hat of the given polynomial 𝑓 ∈ 𝑅𝑞. Input: array 𝑓 ∈ ℤ256 ▷ the coefficients of the input polynomial Output: array 𝑓_hat ∈ ℤ256 ▷ the coefficients of the NTT of the input polynomial Note: this is exposed publicly only for testing purposes and there is no good reason to use it in production code.
Sourcepub fn inv_ntt(&mut self)
pub fn inv_ntt(&mut self)
Algorithm 10 NTT (𝑓_hat) Computes the polynomial 𝑓 ∈ 𝑅𝑞 that corresponds to the given NTT representation 𝑓 ∈ 𝑇𝑞. Input: array 𝑓 ∈ ℤ256 ▷ the coefficients of input NTT representation Output: array 𝑓 ∈ ℤ256 ▷ the coefficients of the inverse NTT of the input Note: this is exposed publicly only for testing purposes and there is no good reason to use it in production code.
Trait Implementations§
Source§impl Clone for Polynomial
impl Clone for Polynomial
Source§fn clone(&self) -> Polynomial
fn clone(&self) -> Polynomial
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Polynomial
impl Debug for Polynomial
Source§impl Display for Polynomial
impl Display for Polynomial
Source§impl Drop for Polynomial
impl Drop for Polynomial
Source§impl Index<usize> for Polynomial
Convenience function to avoid “.0” all over the place.
impl Index<usize> for Polynomial
Convenience function to avoid “.0” all over the place.
Source§impl IndexMut<usize> for Polynomial
Convenience function to avoid “.0” all over the place.
impl IndexMut<usize> for Polynomial
Convenience function to avoid “.0” all over the place.