ark-curves-cherry-picked/mnt4_298/src/fields/fq4.rs
mnt4_298/src/fields/fq4.rsRaw
1use crate::{Fq, Fq2, Fq2Parameters, FQ_ONE, FQ_ZERO};
2use ark_ff::{
3 biginteger::BigInteger320 as BigInteger,
4 field_new,
5 fields::fp4::{Fp4, Fp4Parameters},
6};
7
8pub type Fq4 = Fp4<Fq4Parameters>;
9
10pub struct Fq4Parameters;
11
12impl Fp4Parameters for Fq4Parameters {
13 type Fp2Params = Fq2Parameters;
14
15 const NONRESIDUE: Fq2 = field_new!(Fq2, FQ_ZERO, FQ_ONE);
16
17 // Coefficients for the Frobenius automorphism.
18 // c1[0] = 1,
19 // c1[1] = 7684163245453501615621351552473337069301082060976805004625011694147890954040864167002308
20 // c1[2] = 475922286169261325753349249653048451545124879242694725395555128576210262817955800483758080
21 // c1[3] = 468238122923807824137727898100575114475823797181717920390930116882062371863914936316755773
22 #[rustfmt::skip]
23 const FROBENIUS_COEFF_FP4_C1: &'static [Fq] = &[
24 FQ_ONE,
25 field_new!(
26 Fq,
27 BigInteger([
28 16439849825752526567,
29 14772594681319164557,
30 16175669228740845684,
31 4590896976404796446,
32 3810243174413
33 ])
34 ),
35 field_new!(
36 Fq,
37 BigInteger([
38 12702890790846888869,
39 6326265861366186013,
40 364584707886187945,
41 8740893163049517815,
42 2181130330288
43 ])
44 ),
45 field_new!(
46 Fq,
47 BigInteger([
48 16494084033238978842,
49 8405712270147289988,
50 16893921313687769205,
51 7111183964905832559,
52 299901908070
53 ])
54 ),
55 ];
56}