ark-curves-cherry-picked/mnt4_753/src/fields/fq2.rs
mnt4_753/src/fields/fq2.rsRaw
1use crate::{Fq, FQ_ONE};
2use ark_ff::{
3 field_new,
4 fields::fp2::{Fp2, Fp2Parameters},
5};
6
7pub type Fq2 = Fp2<Fq2Parameters>;
8
9pub struct Fq2Parameters;
10
11impl Fp2Parameters for Fq2Parameters {
12 type Fp = Fq;
13
14 // non_residue = 13
15 #[rustfmt::skip]
16 const NONRESIDUE: Fq = field_new!(Fq, "13");
17
18 // qnr = (8, 1)
19 const QUADRATIC_NONRESIDUE: (Self::Fp, Self::Fp) = (field_new!(Fq, "8"), FQ_ONE);
20
21 // Coefficients:
22 // [1, 41898490967918953402344214791240637128170709919953949071783502921025352812571106773058893763790338921418070971888253786114353726529584385201591605722013126468931404347949840543007986327743462853720628051692141265303114721689600]
23 // see https://github.com/o1-labs/snarky/blob/2cf5ef3a14989e57c17518832b3c52590068fc48/src/camlsnark_c/libsnark-caml/depends/libff/libff/algebra/curves/mnt753/mnt4753/mnt4753_init.cpp
24 const FROBENIUS_COEFF_FP2_C1: &'static [Self::Fp] = &[
25 FQ_ONE,
26 field_new!(Fq, "41898490967918953402344214791240637128170709919953949071783502921025352812571106773058893763790338921418070971888253786114353726529584385201591605722013126468931404347949840543007986327743462853720628051692141265303114721689600"),
27 ];
28}