QUADRATIC_NONRESIDUE is never used, remove (#104)

* `QUADRATIC_NONRESIDUE` is never used, remove

* Update CHANGELOG.md

* Remove unused imports
This commit is contained in:
Marcin
2022-06-30 20:00:01 +02:00
committed by GitHub
parent 9a89ea8adc
commit 76579d0fbb
7 changed files with 6 additions and 41 deletions

View File

@@ -12,9 +12,6 @@ impl Fp2Config for Fq2Config {
/// NONRESIDUE = -5
const NONRESIDUE: Fq = MontFp!(Fq, "-5");
/// QUADRATIC_NONRESIDUE = U
const QUADRATIC_NONRESIDUE: Fq2 = QuadExt!(FQ_ZERO, FQ_ONE);
/// Coefficients for the Frobenius automorphism.
const FROBENIUS_COEFF_FP2_C1: &'static [Fq] = &[
// NONRESIDUE**(((q^0) - 1) / 2)

View File

@@ -3,7 +3,7 @@ use ark_algebra_test_templates::{
};
use ark_ff::{
biginteger::{BigInt, BigInteger, BigInteger384},
fields::{FftField, Field, Fp2Config, Fp6Config, PrimeField, SquareRootField},
fields::{FftField, Field, Fp6Config, PrimeField, SquareRootField},
One, UniformRand, Zero,
};
use ark_serialize::{buffer_bit_byte_size, CanonicalSerialize};
@@ -13,7 +13,7 @@ use core::{
ops::{AddAssign, MulAssign, SubAssign},
};
use crate::{Fq, Fq12, Fq2, Fq2Config, Fq6, Fq6Config, FqConfig, Fr, FrConfig};
use crate::{Fq, Fq12, Fq2, Fq6, Fq6Config, FqConfig, Fr, FrConfig};
generate_field_test!(bls12_377; fq2; fq6; fq12; mont(6, 4); );
generate_field_serialization_test!(bls12_377; fq2; fq6; fq12;);
@@ -146,26 +146,6 @@ fn test_fq2_legendre() {
assert_eq!(QuadraticNonResidue, m1.legendre());
}
#[test]
fn test_fq2_mul_nonresidue() {
let mut rng = test_rng();
let nqr = Fq2::new(Fq::zero(), Fq::one());
let quadratic_non_residue = Fq2::new(
Fq2Config::QUADRATIC_NONRESIDUE.c0,
Fq2Config::QUADRATIC_NONRESIDUE.c1,
);
for _ in 0..1000 {
let mut a = Fq2::rand(&mut rng);
let mut b = a;
a = quadratic_non_residue * &a;
b.mul_assign(&nqr);
assert_eq!(a, b);
}
}
#[test]
fn test_fq6_mul_by_1() {
let mut rng = test_rng();