Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/integer/mat_poly_over_z/arithmetic/mul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Mul<&MatPolynomialRingZq> for &MatPolyOverZ {
/// use std::str::FromStr;
///
/// let mat_1 = MatPolyOverZ::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]]").unwrap();
/// let mat_2 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 3 mod 17").unwrap();
/// let mat_2 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 1 mod 17").unwrap();
///
/// let mat_3 = &mat_1 * &mat_2;
/// ```
Expand Down Expand Up @@ -151,7 +151,7 @@ impl MatPolyOverZ {
/// use std::str::FromStr;
///
/// let mat_1 = MatPolyOverZ::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]]").unwrap();
/// let mat_2 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 3 mod 17").unwrap();
/// let mat_2 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 1 mod 17").unwrap();
///
/// let mat_3 = &mat_1.mul_mat_poly_ring_zq_safe(&mat_2).unwrap();
/// ```
Expand Down
2 changes: 1 addition & 1 deletion src/integer/mat_poly_over_z/arithmetic/mul_scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ mod test_mul_poly_ring_zq {
/// Checks if scalar multiplication reduction works.
#[test]
fn reduction_correct() {
let modulus = ModulusPolynomialRingZq::from_str("4 2 0 0 2 mod 17").unwrap();
let modulus = ModulusPolynomialRingZq::from_str("4 1 0 0 1 mod 17").unwrap();
let poly_mat1 = MatPolyOverZ::from_str("[[0, 1 10],[0, 2 1 2]]").unwrap();
let poly = PolyOverZ::from(2);
let poly_ring = PolynomialRingZq::from((&poly, &modulus));
Expand Down
4 changes: 2 additions & 2 deletions src/integer/mat_poly_over_z/arithmetic/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl Sub<&MatPolynomialRingZq> for &MatPolyOverZ {
/// use std::str::FromStr;
///
/// let mat_1 = MatPolyOverZ::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]]").unwrap();
/// let mat_2 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 3 mod 17").unwrap();
/// let mat_2 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 1 mod 17").unwrap();
///
/// let mat_3 = &mat_1 - &mat_2;
/// ```
Expand Down Expand Up @@ -192,7 +192,7 @@ impl MatPolyOverZ {
/// use std::str::FromStr;
///
/// let mat_1 = MatPolyOverZ::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]]").unwrap();
/// let mat_2 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 3 mod 17").unwrap();
/// let mat_2 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 1 mod 17").unwrap();
///
/// let mat_3 = &mat_1.sub_mat_poly_ring_zq_safe(&mat_2).unwrap();
/// ```
Expand Down
18 changes: 5 additions & 13 deletions src/integer/poly_over_z/arithmetic/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use crate::{
};
use flint_sys::{
fmpq_poly::fmpq_poly_sub, fmpz_mod_poly::fmpz_mod_poly_sub, fmpz_poly::fmpz_poly_sub,
fq::fq_sub,
};
use std::ops::{Sub, SubAssign};

Expand Down Expand Up @@ -148,15 +147,8 @@ impl Sub<&PolynomialRingZq> for &PolyOverZ {
/// let c: PolynomialRingZq = &b - &a;
/// ```
fn sub(self, other: &PolynomialRingZq) -> Self::Output {
let mut out = PolynomialRingZq::from((&PolyOverZ::default(), &other.modulus));
unsafe {
fq_sub(
&mut out.poly.poly,
&self.poly,
&other.poly.poly,
other.modulus.get_fq_ctx(),
);
}
let mut out = PolynomialRingZq::from((self, &other.modulus));
out -= other;
out
}
}
Expand Down Expand Up @@ -352,10 +344,10 @@ mod test_sub_poly_ring_zq {
#[test]
fn borrowed_correctness() {
let poly_1 =
PolynomialRingZq::from_str(&format!("2 2 {} / 4 1 2 3 4 mod {}", i64::MAX, u64::MAX))
PolynomialRingZq::from_str(&format!("2 2 {} / 4 1 2 3 1 mod {}", i64::MAX, u64::MAX))
.unwrap();
let poly_2 = PolynomialRingZq::from_str(&format!(
"2 -1 -{} / 4 1 2 3 4 mod {}",
"2 -1 -{} / 4 1 2 3 1 mod {}",
i64::MAX as u64 - 2,
u64::MAX
))
Expand All @@ -370,7 +362,7 @@ mod test_sub_poly_ring_zq {
/// Checks if subtraction works fine for different types
#[test]
fn availability() {
let poly = PolynomialRingZq::from_str("3 1 2 3 / 4 1 2 3 4 mod 17").unwrap();
let poly = PolynomialRingZq::from_str("3 1 2 3 / 4 1 2 3 1 mod 17").unwrap();
let z = PolyOverZ::from(2);

_ = z.clone() - poly.clone();
Expand Down
2 changes: 1 addition & 1 deletion src/integer_mod_q/mat_ntt_polynomial_ring_zq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl fmt::Debug for MatNTTPolynomialRingZq {
pub(crate) fn print_vec_z(vector: &Vec<Z>) -> String {
let mut out = String::new();
for v in vector {
out.push_str(&format!("{}, ", v));
out.push_str(&format!("{v}, "));
}
// Remove last whitespace and comma
out.pop().unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl Add for &MatNTTPolynomialRingZq {
if !self.compare_base(other) {
panic!("{}", self.call_compare_base_error(other).unwrap());
}
let mod_ctx = &self.modulus.get_fq_ctx().ctxp[0];
let mod_ctx = &self.modulus.get_q_as_modulus();

let mut out = MatNTTPolynomialRingZq {
matrix: vec![
Expand All @@ -77,7 +77,7 @@ impl Add for &MatNTTPolynomialRingZq {
&mut out.matrix[i].value,
&self.matrix[i].value,
&other.matrix[i].value,
mod_ctx,
mod_ctx.get_fmpz_mod_ctx_struct(),
);
}
}
Expand Down Expand Up @@ -138,15 +138,15 @@ impl AddAssign<&MatNTTPolynomialRingZq> for MatNTTPolynomialRingZq {
if !self.compare_base(other) {
panic!("{}", self.call_compare_base_error(other).unwrap());
}
let mod_ctx = &self.modulus.get_fq_ctx().ctxp[0];
let mod_ctx = &self.modulus.get_q_as_modulus();

for i in 0..self.matrix.len() {
unsafe {
fmpz_mod_add_fmpz(
&mut self.matrix[i].value,
&self.matrix[i].value,
&other.matrix[i].value,
mod_ctx,
mod_ctx.get_fmpz_mod_ctx_struct(),
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ impl Mul for &MatNTTPolynomialRingZq {
panic!("{}", self.call_compare_base_error(other).unwrap());
}

let mod_ctx = &self.modulus.get_fq_ctx().ctxp[0];
let binding = self.modulus.get_q_as_modulus();
let mod_ctx = binding.get_fmpz_mod_ctx_struct();

let mut res = Vec::with_capacity(other.matrix.len());

Expand Down
10 changes: 7 additions & 3 deletions src/integer_mod_q/mat_ntt_polynomial_ring_zq/arithmetic/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ impl Sub for &MatNTTPolynomialRingZq {
if !self.compare_base(other) {
panic!("{}", self.call_compare_base_error(other).unwrap());
}
let mod_ctx = &self.modulus.get_fq_ctx().ctxp[0];

let binding = self.modulus.get_q_as_modulus();
let mod_ctx = binding.get_fmpz_mod_ctx_struct();

let mut out = MatNTTPolynomialRingZq {
matrix: vec![
Expand Down Expand Up @@ -136,15 +138,17 @@ impl SubAssign<&MatNTTPolynomialRingZq> for MatNTTPolynomialRingZq {
if !self.compare_base(other) {
panic!("{}", self.call_compare_base_error(other).unwrap());
}
let mod_q = &self.modulus.get_fq_ctx().ctxp[0];

let binding = self.modulus.get_q_as_modulus();
let mod_ctx = binding.get_fmpz_mod_ctx_struct();

for i in 0..self.matrix.len() {
unsafe {
fmpz_mod_sub_fmpz(
&mut self.matrix[i].value,
&self.matrix[i].value,
&other.matrix[i].value,
mod_q,
mod_ctx,
)
};
}
Expand Down
21 changes: 9 additions & 12 deletions src/integer_mod_q/mat_polynomial_ring_zq/arithmetic/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl Add<&MatPolyOverZ> for &MatPolynomialRingZq {
/// use qfall_math::integer::MatPolyOverZ;
/// use std::str::FromStr;
///
/// let mat_1 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 3 mod 17").unwrap();
/// let mat_1 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 1 mod 17").unwrap();
/// let mat_2 = MatPolyOverZ::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]]").unwrap();
///
/// let mat_3 = &mat_1 + &mat_2;
Expand Down Expand Up @@ -252,7 +252,7 @@ impl MatPolynomialRingZq {
/// use qfall_math::integer::MatPolyOverZ;
/// use std::str::FromStr;
///
/// let mat_1 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 3 mod 17").unwrap();
/// let mat_1 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 1 mod 17").unwrap();
/// let mat_2 = MatPolyOverZ::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]]").unwrap();
///
/// let mat_3 = &mat_1.add_mat_poly_over_z_safe(&mat_2).unwrap();
Expand Down Expand Up @@ -468,11 +468,8 @@ mod test_add {
/// Testing addition for large [`MatPolynomialRingZq`]
#[test]
fn add_large_numbers() {
let modulus = ModulusPolynomialRingZq::from_str(&format!(
"5 1 1 0 0 {} mod {LARGE_PRIME}",
i64::MAX
))
.unwrap();
let modulus =
ModulusPolynomialRingZq::from_str(&format!("5 1 1 0 0 1 mod {LARGE_PRIME}")).unwrap();
let poly_mat_1 = MatPolyOverZ::from_str(&format!(
"[[4 1 {} 1 1, 1 42],[0, 2 {} 2]]",
i64::MAX,
Expand Down Expand Up @@ -513,7 +510,7 @@ mod test_add {
#[test]
#[should_panic]
fn add_mismatching_modulus_polynomial() {
let modulus_1 = ModulusPolynomialRingZq::from_str("4 1 0 0 2 mod 17").unwrap();
let modulus_1 = ModulusPolynomialRingZq::from_str("4 2 0 0 1 mod 17").unwrap();
let poly_mat_1 = MatPolyOverZ::from_str("[[4 -1 0 1 1, 1 42],[0, 2 1 2]]").unwrap();
let poly_ring_mat_1 = MatPolynomialRingZq::from((&poly_mat_1, &modulus_1));
let modulus_2 = ModulusPolynomialRingZq::from_str("4 1 0 0 1 mod 17").unwrap();
Expand All @@ -527,7 +524,7 @@ mod test_add {
#[test]
#[should_panic]
fn add_mismatching_dim() {
let modulus_1 = ModulusPolynomialRingZq::from_str("4 1 0 0 2 mod 17").unwrap();
let modulus_1 = ModulusPolynomialRingZq::from_str("4 1 0 0 1 mod 17").unwrap();
let poly_mat_1 = MatPolyOverZ::from_str("[[1 42],[2 1 2]]").unwrap();
let poly_ring_mat_1 = MatPolynomialRingZq::from((&poly_mat_1, &modulus_1));
let modulus_2 = ModulusPolynomialRingZq::from_str("4 1 0 0 1 mod 17").unwrap();
Expand All @@ -540,10 +537,10 @@ mod test_add {
/// Testing whether add_safe throws an error for mismatching moduli
#[test]
fn add_safe_is_err_moduli() {
let modulus_1 = ModulusPolynomialRingZq::from_str("4 1 0 0 2 mod 17").unwrap();
let modulus_1 = ModulusPolynomialRingZq::from_str("4 1 0 0 1 mod 17").unwrap();
let poly_mat_1 = MatPolyOverZ::from_str("[[4 -1 0 1 1, 1 42],[0, 2 1 2]]").unwrap();
let poly_ring_mat_1 = MatPolynomialRingZq::from((&poly_mat_1, &modulus_1));
let modulus_2 = ModulusPolynomialRingZq::from_str("4 1 0 0 1 mod 17").unwrap();
let modulus_2 = ModulusPolynomialRingZq::from_str("4 2 0 0 1 mod 17").unwrap();
let poly_mat_2 = MatPolyOverZ::from_str("[[3 3 0 1, 1 42],[0, 1 17]]").unwrap();
let poly_ring_mat_2 = MatPolynomialRingZq::from((&poly_mat_2, &modulus_2));

Expand All @@ -553,7 +550,7 @@ mod test_add {
/// Testing whether add_safe throws an error for different dimensions
#[test]
fn add_safe_is_err_dim() {
let modulus_1 = ModulusPolynomialRingZq::from_str("4 1 0 0 2 mod 17").unwrap();
let modulus_1 = ModulusPolynomialRingZq::from_str("4 1 0 0 1 mod 17").unwrap();
let poly_mat_1 = MatPolyOverZ::from_str("[[4 -1 0 1 1],[2 1 2]]").unwrap();
let poly_ring_mat_1 = MatPolynomialRingZq::from((&poly_mat_1, &modulus_1));
let modulus_2 = ModulusPolynomialRingZq::from_str("4 1 0 0 1 mod 17").unwrap();
Expand Down
6 changes: 3 additions & 3 deletions src/integer_mod_q/mat_polynomial_ring_zq/arithmetic/mul.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl Mul<&MatPolyOverZ> for &MatPolynomialRingZq {
/// use qfall_math::integer::MatPolyOverZ;
/// use std::str::FromStr;
///
/// let mat_1 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 3 mod 17").unwrap();
/// let mat_1 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 1 mod 17").unwrap();
/// let mat_2 = MatPolyOverZ::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]]").unwrap();
///
/// let mat_3 = &mat_1 * &mat_2;
Expand Down Expand Up @@ -176,7 +176,7 @@ impl MatPolynomialRingZq {
/// use qfall_math::integer::MatPolyOverZ;
/// use std::str::FromStr;
///
/// let mat_1 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 3 mod 17").unwrap();
/// let mat_1 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 1 mod 17").unwrap();
/// let mat_2 = MatPolyOverZ::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]]").unwrap();
///
/// let mat_3 = &mat_1.mul_mat_poly_over_z_safe(&mat_2).unwrap();
Expand Down Expand Up @@ -269,7 +269,7 @@ mod test_mul {
#[test]
fn errors() {
let modulus_1 = ModulusPolynomialRingZq::from_str("4 1 0 0 1 mod 17").unwrap();
let modulus_2 = ModulusPolynomialRingZq::from_str("4 1 0 0 2 mod 17").unwrap();
let modulus_2 = ModulusPolynomialRingZq::from_str("4 1 0 2 1 mod 17").unwrap();

let poly_mat_1 = MatPolyOverZ::from_str("[[4 -1 0 1 1, 1 42],[0, 2 1 2]]").unwrap();
let poly_ring_mat_1 = MatPolynomialRingZq::from((&poly_mat_1, &modulus_1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ impl MatPolynomialRingZq {
/// use qfall_math::integer_mod_q::{MatPolynomialRingZq, Zq};
/// use std::str::FromStr;
///
/// let mat_1 = MatPolynomialRingZq::from_str("[[1 42, 1 17],[2 1 8, 1 6]] / 3 1 2 3 mod 61").unwrap();
/// let mat_1 = MatPolynomialRingZq::from_str("[[1 42, 1 17],[2 1 8, 1 6]] / 3 1 2 1 mod 61").unwrap();
/// let integer = Zq::from((2, 61));
///
/// let mat_2 = &mat_1.mul_scalar_zq_safe(&integer).unwrap();
Expand Down Expand Up @@ -745,7 +745,7 @@ mod test_mul_zq {
#[test]
#[should_panic]
fn different_moduli_error() {
let mat_1 = MatPolynomialRingZq::from_str("[[1 42],[0],[1 2]] / 2 1 2 mod 61").unwrap();
let mat_1 = MatPolynomialRingZq::from_str("[[1 42],[0],[1 2]] / 2 1 1 mod 61").unwrap();
let integer = Zq::from((2, 3));

_ = &integer * mat_1;
Expand All @@ -754,7 +754,7 @@ mod test_mul_zq {
/// Checks if scalar multiplication returns an error if the moduli mismatch
#[test]
fn different_moduli_error_safe() {
let mat_1 = MatPolynomialRingZq::from_str("[[1 42],[0],[1 2]] / 2 1 2 mod 61").unwrap();
let mat_1 = MatPolynomialRingZq::from_str("[[1 42],[0],[1 2]] / 2 1 1 mod 61").unwrap();
let integer = Zq::from((2, 3));

let mat_2 = &mat_1.mul_scalar_zq_safe(&integer);
Expand Down Expand Up @@ -809,7 +809,7 @@ mod test_mul_poly_over_z {
/// Checks if scalar multiplication reduction works.
#[test]
fn reduction_correct() {
let modulus = ModulusPolynomialRingZq::from_str("4 2 0 0 2 mod 17").unwrap();
let modulus = ModulusPolynomialRingZq::from_str("4 1 0 0 1 mod 17").unwrap();
let poly_mat1 = MatPolyOverZ::from_str("[[0, 1 10],[0, 2 1 2]]").unwrap();
let poly_ring_mat1 = MatPolynomialRingZq::from((&poly_mat1, &modulus));
let poly = PolyOverZ::from_str("3 1 0 2").unwrap();
Expand Down Expand Up @@ -914,7 +914,7 @@ mod test_mul_poly_over_zq {
/// Checks if scalar multiplication reduction works.
#[test]
fn reduction_correct() {
let modulus = ModulusPolynomialRingZq::from_str("4 2 0 0 2 mod 17").unwrap();
let modulus = ModulusPolynomialRingZq::from_str("4 2 0 0 1 mod 17").unwrap();
let poly_mat1 = MatPolyOverZ::from_str("[[0, 1 10],[0, 2 1 2]]").unwrap();
let poly_ring_mat1 = MatPolynomialRingZq::from((&poly_mat1, &modulus));
let poly = PolyOverZq::from((2, 17));
Expand Down Expand Up @@ -1045,7 +1045,7 @@ mod test_mul_poly_ring_zq {
/// Checks if scalar multiplication reduction works.
#[test]
fn reduction_correct() {
let modulus = ModulusPolynomialRingZq::from_str("4 2 0 0 2 mod 17").unwrap();
let modulus = ModulusPolynomialRingZq::from_str("4 2 0 0 1 mod 17").unwrap();
let poly_mat1 = MatPolyOverZ::from_str("[[0, 1 10],[0, 2 1 2]]").unwrap();
let poly_ring_mat1 = MatPolynomialRingZq::from((&poly_mat1, &modulus));
let poly = PolyOverZ::from(2);
Expand Down
4 changes: 2 additions & 2 deletions src/integer_mod_q/mat_polynomial_ring_zq/arithmetic/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl Sub<&MatPolyOverZ> for &MatPolynomialRingZq {
/// use qfall_math::integer::MatPolyOverZ;
/// use std::str::FromStr;
///
/// let mat_1 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 3 mod 17").unwrap();
/// let mat_1 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 1 mod 17").unwrap();
/// let mat_2 = MatPolyOverZ::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]]").unwrap();
///
/// let mat_3 = &mat_1 - &mat_2;
Expand Down Expand Up @@ -230,7 +230,7 @@ impl MatPolynomialRingZq {
/// use qfall_math::integer::MatPolyOverZ;
/// use std::str::FromStr;
///
/// let mat_1 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 3 mod 17").unwrap();
/// let mat_1 = MatPolynomialRingZq::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]] / 3 1 2 1 mod 17").unwrap();
/// let mat_2 = MatPolyOverZ::from_str("[[2 1 42, 1 17],[1 8, 2 5 6]]").unwrap();
///
/// let mat_3 = &mat_1.sub_mat_poly_over_z_safe(&mat_2).unwrap();
Expand Down
6 changes: 3 additions & 3 deletions src/integer_mod_q/mat_polynomial_ring_zq/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ mod test_compare_base {
assert!(!one_1.compare_base(&MatPolynomialRingZq::identity(10, 7, &modulus_other)));
assert!(one_1.compare_base(&Zq::from((3, 17))));
assert!(!one_1.compare_base(&Zq::from((3, 18))));
assert!(one_1.compare_base(&PolyOverZq::from_str("1 3 mod 17").unwrap()));
assert!(!one_1.compare_base(&PolyOverZq::from_str("1 3 mod 18").unwrap()));
assert!(one_1.compare_base(&PolyOverZq::from_str("1 1 mod 17").unwrap()));
assert!(!one_1.compare_base(&PolyOverZq::from_str("1 1 mod 18").unwrap()));
assert!(one_1.compare_base(&MatZq::new(1, 1, 17)));
assert!(!one_1.compare_base(&MatZq::new(1, 1, 18)));
assert!(one_1.compare_base(&PolynomialRingZq::from(&modulus)));
Expand All @@ -106,7 +106,7 @@ mod test_compare_base {
assert!(one_1.call_compare_base_error(&Zq::from((3, 18))).is_some());
assert!(
one_1
.call_compare_base_error(&PolyOverZq::from_str("1 3 mod 18").unwrap())
.call_compare_base_error(&PolyOverZq::from_str("1 1 mod 18").unwrap())
.is_some()
);
assert!(
Expand Down
Loading
Loading