ark-curves-cherry-picked/mnt4_298/src/fields/fq2.rs
mnt4_298/src/fields/fq2.rsRaw
1use ark_ff::{
2 fields::fp2::{Fp2, Fp2Config},
3 MontFp,
4};
5
6use crate::{Fq, FQ_ONE};
7
8pub type Fq2 = Fp2<Fq2Config>;
9
10pub struct Fq2Config;
11
12impl Fp2Config for Fq2Config {
13 type Fp = Fq;
14
15 /// The quadratic non-residue (17) used to construct the extension is
16 /// the same as that used in [`libff`](https://github.com/scipr-lab/libff/blob/c927821ebe02e0a24b5e0f9170cec5e211a35f08/libff/algebra/curves/mnt/mnt4/mnt4_init.cpp#L102).
17 const NONRESIDUE: Fq = MontFp!(Fq, "17");
18
19 /// Precomputed coefficients:
20 /// `[1, 475922286169261325753349249653048451545124879242694725395555128576210262817955800483758080]`
21 const FROBENIUS_COEFF_FP2_C1: &'static [Self::Fp] = &[
22 FQ_ONE,
23 MontFp!(Fq, "475922286169261325753349249653048451545124879242694725395555128576210262817955800483758080"),
24 ];
25}