ark-curves-cherry-picked/mnt6_298/src/fields/fq3.rs
mnt6_298/src/fields/fq3.rsRaw
1use crate::{fq::Fq, FQ_ZERO};
2use ark_ff::{
3 field_new,
4 fields::fp3::{Fp3, Fp3Parameters},
5};
6
7pub type Fq3 = Fp3<Fq3Parameters>;
8
9pub struct Fq3Parameters;
10
11impl Fp3Parameters for Fq3Parameters {
12 type Fp = Fq;
13
14 #[rustfmt::skip]
15 const NONRESIDUE: Fq = field_new!(Fq, "5");
16
17 const TWO_ADICITY: u32 = 34;
18
19 #[rustfmt::skip]
20 const T_MINUS_ONE_DIV_TWO: &'static [u64] = &[
21 0x69232b75663933bd,
22 0xca650efcfc00ee0,
23 0x77ca3963fe36f720,
24 0xe4cb46632f9bcf7e,
25 0xef510453f08f9f30,
26 0x9dd5b8fc72f02d83,
27 0x7f8d017ed86608ab,
28 0xeb2219b3697c97a4,
29 0xc8663846ab96996f,
30 0x833cd532053eac7d,
31 0x1d5b73dfb20bd3cc,
32 0x6f5f6da606b59873,
33 0x62e990f43dfc42d6,
34 0x6878f58,
35 ];
36
37 #[rustfmt::skip]
38 const QUADRATIC_NONRESIDUE_TO_T: (Fq, Fq, Fq) = (
39 field_new!(Fq, "154361449678783505076984156275977937654331103361174469632346230549735979552469642799720052"),
40 FQ_ZERO,
41 FQ_ZERO,
42 );
43
44 #[rustfmt::skip]
45 const FROBENIUS_COEFF_FP3_C1: &'static [Fq] = &[
46 field_new!(Fq, "1"),
47 field_new!(Fq, "471738898967521029133040851318449165997304108729558973770077319830005517129946578866686956"),
48 field_new!(Fq, "4183387201740296620308398334599285547820769823264541783190415909159130177461911693276180"),
49 ];
50
51 #[rustfmt::skip]
52 const FROBENIUS_COEFF_FP3_C2: &'static [Fq] = &[
53 Self::FROBENIUS_COEFF_FP3_C1[0],
54 Self::FROBENIUS_COEFF_FP3_C1[2],
55 Self::FROBENIUS_COEFF_FP3_C1[1],
56 ];
57}