MatNTTPolynomialRingZq

Struct MatNTTPolynomialRingZq 

Source
pub struct MatNTTPolynomialRingZq {
    pub matrix: Vec<Z>,
    pub nr_rows: usize,
    pub nr_columns: usize,
    pub modulus: ModulusPolynomialRingZq,
}
Expand description

MatNTTPolynomialRingZq contains the NTT representation of a matrix over polynomials with respect to a NTTBasisPolynomialRingZq that itself isn’t aware of.

Any polynomial in NTT representation in row i and column j can be accessed via matrix[j * nr_columns + i].

Attributes

  • matrix: holds the matrix entries with its coefficients
  • nr_rows: the number of rows of the matrix
  • nr_columns: the number of columns of the matrix
  • modulus: the ModulusPolynomialRingZq defining the modulus q, the ring Z_q[X]/f(X), and the NTT transform NTTBasisPolynomialRingZq

§Examples

use qfall_math::integer_mod_q::{Modulus, MatPolynomialRingZq, MatNTTPolynomialRingZq, ModulusPolynomialRingZq};
use std::str::FromStr;

// setup modulus with ability to transform to NTT
let mut modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 257").unwrap();
modulus.set_ntt_unchecked(64);

// sample random matrix
let mat_rnd = MatNTTPolynomialRingZq::sample_uniform(2, 2, &modulus);
// or instantiate matrix from MatPolynomialRingZq
let mat_poly_ring = MatPolynomialRingZq::identity(2, 2, &modulus);
let mat_ntt_poly_ring = MatNTTPolynomialRingZq::from(&mat_poly_ring);

// multiply, add and subtract objects
let mut tmp_mat_ntt = mat_ntt_poly_ring * &mat_rnd;
tmp_mat_ntt += &mat_rnd;
tmp_mat_ntt -= &mat_rnd;

// Return to MatPolynomialRingZq
let res = tmp_mat_ntt.inv_ntt();

Fields§

§matrix: Vec<Z>§nr_rows: usize§nr_columns: usize§modulus: ModulusPolynomialRingZq

Implementations§

Source§

impl MatNTTPolynomialRingZq

Source

pub fn inv_ntt(self) -> MatPolynomialRingZq

Computes the inverse NTT of self with respect to the given modulus.

Returns a new MatPolynomialRingZq with the entries from self.

§Examples
use qfall_math::integer_mod_q::{MatPolynomialRingZq, MatNTTPolynomialRingZq, ModulusPolynomialRingZq};
use std::str::FromStr;
let mut modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 257").unwrap();
modulus.set_ntt_unchecked(64);
let ntt_mat = MatNTTPolynomialRingZq::sample_uniform(1, 1, &modulus);

let poly_ring_mat = ntt_mat.inv_ntt();
§Panics …
Source§

impl MatNTTPolynomialRingZq

Source

pub fn get_mod(&self) -> ModulusPolynomialRingZq

Returns the modulus of the matrix in NTT representation as a ModulusPolynomialRingZq.

§Examples
use qfall_math::integer_mod_q::{MatNTTPolynomialRingZq, ModulusPolynomialRingZq};
use std::str::FromStr;

let modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 17").unwrap();
let matrix = MatNTTPolynomialRingZq::sample_uniform(2, 2, &modulus);

let modulus = matrix.get_mod();
Source

pub fn get_entry(&self, row: usize, column: usize) -> &[Z]

Returns the slice of matrix corresponding to the entry in row row and column column.

Parameters:

  • row: defines the row where the entry to fetch is located
  • column: defines the column where the entry to fetch is located

Returns a slice &[Z] containing the requested entry.

§Examples
use qfall_math::integer_mod_q::{MatNTTPolynomialRingZq, ModulusPolynomialRingZq};
use std::str::FromStr;
let mut modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 257").unwrap();
modulus.set_ntt_unchecked(64);

let matrix = MatNTTPolynomialRingZq::sample_uniform(2, 2, &modulus);
let entry = matrix.get_entry(0, 0);

assert_eq!(4, entry.len());
§Panics …
  • if row >= self.get_num_rows() or column >= self.get_num_columns().
Source§

impl MatNTTPolynomialRingZq

Source

pub fn sample_uniform( nr_rows: usize, nr_columns: usize, modulus: &ModulusPolynomialRingZq, ) -> Self

Generates a MatNTTPolynomialRingZq instance with maximum degree modulus_degree and entries chosen uniform at random in [0, modulus).

The internally used uniform at random chosen bytes are generated by ThreadRng, which uses ChaCha12 and is considered cryptographically secure.

Parameters:

  • num_rows: defines the number of rows of the matrix
  • num_columns: defines the number of columns of the matrix
  • modulus_degree: specifies the degree of the modulus polynomial, i.e. the maximum number of sampled coefficients is modulus_degree - 1
  • modulus: specifies the modulus of the values and thus, the interval size over which is sampled

Returns a fresh MatNTTPolynomialRingZq instance of length modulus_degree with entries chosen uniform at random in [0, modulus).

§Examples
use qfall_math::integer_mod_q::{MatNTTPolynomialRingZq, ModulusPolynomialRingZq};
use std::str::FromStr;
let mut modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 257").unwrap();
modulus.set_ntt_unchecked(64);

let sample = MatNTTPolynomialRingZq::sample_uniform(3, 2, &modulus);
§Panics …
  • if nr_rows or nr_columns is 0.

Trait Implementations§

Source§

impl Add for &MatNTTPolynomialRingZq

Source§

fn add(self, other: Self) -> Self::Output

Adds self with other.

Paramters:

  • other: specifies the NTT-representation of the polynomial to add to self

Returns the NTT-representation of the sum of self and other.

§Example
use qfall_math::integer_mod_q::{MatNTTPolynomialRingZq, ModulusPolynomialRingZq};
use crate::qfall_math::traits::SetCoefficient;
use std::str::FromStr;
let mut modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 257").unwrap();
modulus.set_ntt_unchecked(64);

let a = MatNTTPolynomialRingZq::sample_uniform(2, 3, &modulus);
let b = MatNTTPolynomialRingZq::sample_uniform(2, 3, &modulus);

let c = a + b;
§Panics …
  • if the number of rows of self and other or their number of columns is not equal.
  • if their moduli do not match.
Source§

type Output = MatNTTPolynomialRingZq

The resulting type after applying the + operator.
Source§

impl AddAssign<&MatNTTPolynomialRingZq> for MatNTTPolynomialRingZq

Source§

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

Adds self with other reusing the memory of self.

Paramters:

  • other: specifies the NTT-representation of the polynomial to add to self

Computes the NTT-representation of the sum of self and other.

§Example
use qfall_math::integer_mod_q::{MatNTTPolynomialRingZq, ModulusPolynomialRingZq};
use crate::qfall_math::traits::SetCoefficient;
use std::str::FromStr;
let mut modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 257").unwrap();
modulus.set_ntt_unchecked(64);

let mut a = MatNTTPolynomialRingZq::sample_uniform(2, 3, &modulus);
let b = MatNTTPolynomialRingZq::sample_uniform(2, 3, &modulus);

a += b;
§Panics …
  • if the number of rows of self and other or their number of columns is not equal.
  • if their moduli do not match.
Source§

impl AddAssign for MatNTTPolynomialRingZq

Source§

impl Clone for MatNTTPolynomialRingZq

Source§

fn clone(&self) -> MatNTTPolynomialRingZq

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl CompareBase<&MatNTTPolynomialRingZq> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &&MatNTTPolynomialRingZq) -> bool

Compares the moduli of the two elements.

Parameters:

  • other: The other object whose base is compared to self

Returns true if the moduli match and false otherwise.

Source§

fn call_compare_base_error( &self, other: &&MatNTTPolynomialRingZq, ) -> Option<MathError>

Returns an error that gives a small explanation of how the moduli are incomparable.

Parameters:

  • other: The other object whose base is compared to self

Returns a MathError of type MismatchingModulus.

Source§

impl CompareBase<&MatPolyOverZ> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &T) -> bool

Compares the base elements of the objects and returns true if they match and an operation between the two provided types is possible. Read more
Source§

fn call_compare_base_error(&self, other: &T) -> Option<MathError>

Calls an error that gives small explanation how the base elements differ. This function only calls the error and does not check if the two actually differ. Read more
Source§

impl CompareBase<&MatPolynomialRingZq> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &&MatPolynomialRingZq) -> bool

Compares the moduli of the two elements.

Parameters:

  • other: The other object whose base is compared to self

Returns true if the moduli match and false otherwise.

Source§

fn call_compare_base_error( &self, other: &&MatPolynomialRingZq, ) -> Option<MathError>

Returns an error that gives a small explanation of how the moduli are incomparable.

Parameters:

  • other: The other object whose base is compared to self

Returns a MathError of type MismatchingModulus.

Source§

impl CompareBase<&MatZ> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &T) -> bool

Compares the base elements of the objects and returns true if they match and an operation between the two provided types is possible. Read more
Source§

fn call_compare_base_error(&self, other: &T) -> Option<MathError>

Calls an error that gives small explanation how the base elements differ. This function only calls the error and does not check if the two actually differ. Read more
Source§

impl CompareBase<&MatZq> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &&MatZq) -> bool

Compares the moduli of the two elements.

Parameters:

  • other: The other object whose base is compared to self

Returns true if the moduli match and false otherwise.

Source§

fn call_compare_base_error(&self, other: &&MatZq) -> Option<MathError>

Returns an error that gives a small explanation of how the moduli are incomparable.

Parameters:

  • other: The other object whose base is compared to self

Returns a MathError of type MismatchingModulus.

Source§

impl CompareBase<&PolyOverZ> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &T) -> bool

Compares the base elements of the objects and returns true if they match and an operation between the two provided types is possible. Read more
Source§

fn call_compare_base_error(&self, other: &T) -> Option<MathError>

Calls an error that gives small explanation how the base elements differ. This function only calls the error and does not check if the two actually differ. Read more
Source§

impl CompareBase<&PolyOverZq> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &&PolyOverZq) -> bool

Compares the moduli of the two elements.

Parameters:

  • other: The other object whose base is compared to self

Returns true if the moduli match and false otherwise.

Source§

fn call_compare_base_error(&self, other: &&PolyOverZq) -> Option<MathError>

Returns an error that gives a small explanation of how the moduli are incomparable.

Parameters:

  • other: The other object whose base is compared to self

Returns a MathError of type MismatchingModulus.

Source§

impl CompareBase<&PolynomialRingZq> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &&PolynomialRingZq) -> bool

Compares the moduli of the two elements.

Parameters:

  • other: The other object whose base is compared to self

Returns true if the moduli match and false otherwise.

Source§

fn call_compare_base_error( &self, other: &&PolynomialRingZq, ) -> Option<MathError>

Returns an error that gives a small explanation of how the moduli are incomparable.

Parameters:

  • other: The other object whose base is compared to self

Returns a MathError of type MismatchingModulus.

Source§

impl CompareBase<&Zq> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &&Zq) -> bool

Compares the moduli of the two elements.

Parameters:

  • other: The other object whose base is compared to self

Returns true if the moduli match and false otherwise.

Source§

fn call_compare_base_error(&self, other: &&Zq) -> Option<MathError>

Returns an error that gives a small explanation of how the moduli are incomparable.

Parameters:

  • other: The other object whose base is compared to self

Returns a MathError of type MismatchingModulus.

Source§

impl<Integer: Into<Z>> CompareBase<Integer> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &T) -> bool

Compares the base elements of the objects and returns true if they match and an operation between the two provided types is possible. Read more
Source§

fn call_compare_base_error(&self, other: &T) -> Option<MathError>

Calls an error that gives small explanation how the base elements differ. This function only calls the error and does not check if the two actually differ. Read more
Source§

impl CompareBase<MatPolyOverZ> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &T) -> bool

Compares the base elements of the objects and returns true if they match and an operation between the two provided types is possible. Read more
Source§

fn call_compare_base_error(&self, other: &T) -> Option<MathError>

Calls an error that gives small explanation how the base elements differ. This function only calls the error and does not check if the two actually differ. Read more
Source§

impl CompareBase<MatPolynomialRingZq> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &MatPolynomialRingZq) -> bool

Compares the moduli of the two elements.

Parameters:

  • other: The other object whose base is compared to self

Returns true if the moduli match and false otherwise.

Source§

fn call_compare_base_error( &self, other: &MatPolynomialRingZq, ) -> Option<MathError>

Returns an error that gives a small explanation of how the moduli are incomparable.

Parameters:

  • other: The other object whose base is compared to self

Returns a MathError of type MismatchingModulus.

Source§

impl CompareBase<MatZ> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &T) -> bool

Compares the base elements of the objects and returns true if they match and an operation between the two provided types is possible. Read more
Source§

fn call_compare_base_error(&self, other: &T) -> Option<MathError>

Calls an error that gives small explanation how the base elements differ. This function only calls the error and does not check if the two actually differ. Read more
Source§

impl CompareBase<MatZq> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &MatZq) -> bool

Compares the moduli of the two elements.

Parameters:

  • other: The other object whose base is compared to self

Returns true if the moduli match and false otherwise.

Source§

fn call_compare_base_error(&self, other: &MatZq) -> Option<MathError>

Returns an error that gives a small explanation of how the moduli are incomparable.

Parameters:

  • other: The other object whose base is compared to self

Returns a MathError of type MismatchingModulus.

Source§

impl CompareBase<PolyOverZ> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &T) -> bool

Compares the base elements of the objects and returns true if they match and an operation between the two provided types is possible. Read more
Source§

fn call_compare_base_error(&self, other: &T) -> Option<MathError>

Calls an error that gives small explanation how the base elements differ. This function only calls the error and does not check if the two actually differ. Read more
Source§

impl CompareBase<PolyOverZq> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &PolyOverZq) -> bool

Compares the moduli of the two elements.

Parameters:

  • other: The other object whose base is compared to self

Returns true if the moduli match and false otherwise.

Source§

fn call_compare_base_error(&self, other: &PolyOverZq) -> Option<MathError>

Returns an error that gives a small explanation of how the moduli are incomparable.

Parameters:

  • other: The other object whose base is compared to self

Returns a MathError of type MismatchingModulus.

Source§

impl CompareBase<PolynomialRingZq> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &PolynomialRingZq) -> bool

Compares the moduli of the two elements.

Parameters:

  • other: The other object whose base is compared to self

Returns true if the moduli match and false otherwise.

Source§

fn call_compare_base_error(&self, other: &PolynomialRingZq) -> Option<MathError>

Returns an error that gives a small explanation of how the moduli are incomparable.

Parameters:

  • other: The other object whose base is compared to self

Returns a MathError of type MismatchingModulus.

Source§

impl CompareBase<Zq> for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &Zq) -> bool

Compares the moduli of the two elements.

Parameters:

  • other: The other object whose base is compared to self

Returns true if the moduli match and false otherwise.

Source§

fn call_compare_base_error(&self, other: &Zq) -> Option<MathError>

Returns an error that gives a small explanation of how the moduli are incomparable.

Parameters:

  • other: The other object whose base is compared to self

Returns a MathError of type MismatchingModulus.

Source§

impl CompareBase for MatNTTPolynomialRingZq

Source§

fn compare_base(&self, other: &MatNTTPolynomialRingZq) -> bool

Compares the moduli of the two elements.

Parameters:

  • other: The other object whose base is compared to self

Returns true if the moduli match and false otherwise.

Source§

fn call_compare_base_error( &self, other: &MatNTTPolynomialRingZq, ) -> Option<MathError>

Returns an error that gives a small explanation of how the moduli are incomparable.

Parameters:

  • other: The other object whose base is compared to self

Returns a MathError of type MismatchingModulus.

Source§

impl Debug for MatNTTPolynomialRingZq

Source§

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

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

impl<'de> Deserialize<'de> for MatNTTPolynomialRingZq

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for MatNTTPolynomialRingZq

Source§

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

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

impl From<&MatPolynomialRingZq> for MatNTTPolynomialRingZq

Source§

fn from(matrix: &MatPolynomialRingZq) -> Self

Computes the NTT representation of matrix.

Parameters:

  • matrix: the matrix that’s going to be represented in NTT format.

Returns the NTT representation as a MatNTTPolynomialRingZq of matrix.

§Examples
use qfall_math::integer_mod_q::{MatNTTPolynomialRingZq, MatPolynomialRingZq, ModulusPolynomialRingZq};
use std::str::FromStr;
let mut modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 257").unwrap();
modulus.set_ntt_unchecked(64);

let mat_poly_ring = MatPolynomialRingZq::sample_uniform(2, 3, &modulus);

let mat_ntt_poly_ring = MatNTTPolynomialRingZq::from(&mat_poly_ring);
§Panics …
Source§

impl From<MatNTTPolynomialRingZq> for MatPolynomialRingZq

Source§

fn from(matrix: MatNTTPolynomialRingZq) -> Self

Creates a polynomial ring matrix of type MatPolynomialRingZq from the corresponding MatNTTPolynomialRingZq.

Parameters:

  • matrix: the polynomial matrix defining each entry.

Returns a new MatPolynomialRingZq with the entries from matrix.

§Examples
use qfall_math::integer_mod_q::{MatPolynomialRingZq, MatNTTPolynomialRingZq, ModulusPolynomialRingZq};
use std::str::FromStr;
let mut modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 257").unwrap();
modulus.set_ntt_unchecked(64);
let ntt_mat = MatNTTPolynomialRingZq::sample_uniform(1, 1, &modulus);

let poly_ring_mat = MatPolynomialRingZq::from(ntt_mat);
§Panics …
Source§

impl MatrixDimensions for MatNTTPolynomialRingZq

Source§

fn get_num_rows(&self) -> i64

Returns the number of rows of the matrix as an i64.

§Examples
use qfall_math::{integer_mod_q::{MatNTTPolynomialRingZq, ModulusPolynomialRingZq}, traits::MatrixDimensions};
use std::str::FromStr;
let mut modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 257").unwrap();
modulus.set_ntt_unchecked(64);

let matrix = MatNTTPolynomialRingZq::sample_uniform(3, 2, &modulus);
let nr_rows = matrix.get_num_rows();
Source§

fn get_num_columns(&self) -> i64

Returns the number of columns of the matrix as an i64.

§Examples
use qfall_math::{integer_mod_q::{MatNTTPolynomialRingZq, ModulusPolynomialRingZq}, traits::MatrixDimensions};
use std::str::FromStr;
let mut modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 257").unwrap();
modulus.set_ntt_unchecked(64);

let matrix = MatNTTPolynomialRingZq::sample_uniform(3, 2, &modulus);
let nr_columns = matrix.get_num_columns();
Source§

impl Mul for &MatNTTPolynomialRingZq

Source§

fn mul(self, other: Self) -> Self::Output

Multiplies self with other.

Paramters:

  • other: specifies the NTT-representation of the polynomial to multiply to self

Returns the NTT-representation of the multiplication of self and other.

§Example
use qfall_math::integer_mod_q::{MatNTTPolynomialRingZq, ModulusPolynomialRingZq};
use crate::qfall_math::traits::SetCoefficient;
use std::str::FromStr;
let mut modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 257").unwrap();
modulus.set_ntt_unchecked(64);

let a = MatNTTPolynomialRingZq::sample_uniform(2, 3, &modulus);
let b = MatNTTPolynomialRingZq::sample_uniform(3, 4, &modulus);

let c = a * b;
§Panics …
  • if the number of rows of self and the number of columns of other does not match up.
  • if their moduli do not match.
Source§

type Output = MatNTTPolynomialRingZq

The resulting type after applying the * operator.
Source§

impl PartialEq for MatNTTPolynomialRingZq

Source§

fn eq(&self, other: &MatNTTPolynomialRingZq) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for MatNTTPolynomialRingZq

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Sub for &MatNTTPolynomialRingZq

Source§

fn sub(self, other: Self) -> Self::Output

Subtracts other from self.

Paramters:

  • other: specifies the NTT-representation of the polynomial to subtract from self

Returns the NTT-representation of the subtraction of other from self.

§Example
use qfall_math::integer_mod_q::{MatNTTPolynomialRingZq, ModulusPolynomialRingZq};
use std::str::FromStr;
let mut modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 257").unwrap();
modulus.set_ntt_unchecked(64);

let a = MatNTTPolynomialRingZq::sample_uniform(2, 3, &modulus);
let b = MatNTTPolynomialRingZq::sample_uniform(2, 3, &modulus);

let c = a - b;
§Panics …
  • if the number of rows of self and other or their number of columns is not equal.
  • if their moduli do not match.
Source§

type Output = MatNTTPolynomialRingZq

The resulting type after applying the - operator.
Source§

impl SubAssign<&MatNTTPolynomialRingZq> for MatNTTPolynomialRingZq

Source§

fn sub_assign(&mut self, other: &Self)

Subtracts other from self reusing the memory of self.

Paramters:

  • other: specifies the NTT-representation of the polynomial to subtract from self

Computes the NTT-representation of the subtraction of other from self.

§Example
use qfall_math::integer_mod_q::{MatNTTPolynomialRingZq, ModulusPolynomialRingZq};
use std::str::FromStr;
let mut modulus = ModulusPolynomialRingZq::from_str("5  1 0 0 0 1 mod 257").unwrap();
modulus.set_ntt_unchecked(64);

let mut a = MatNTTPolynomialRingZq::sample_uniform(2, 3, &modulus);
let b = MatNTTPolynomialRingZq::sample_uniform(2, 3, &modulus);

a -= b;
§Panics …
  • if the number of rows of self and other or their number of columns is not equal.
  • if their moduli do not match.
Source§

impl SubAssign for MatNTTPolynomialRingZq

Source§

impl Eq for MatNTTPolynomialRingZq

Source§

impl StructuralPartialEq for MatNTTPolynomialRingZq

Auto Trait Implementations§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,