arnaucube
arnaucube/ark-curves-cherry-pickedPublic Self-hosted repository
ark-curves-cherry-picked/mnt6_298/src/fields/fq3.rs
mnt6_298/src/fields/fq3.rsRaw
 1use ark_ff::{
 2    fields::fp3::{Fp3, Fp3Config},
 3    AdditiveGroup, Field, MontFp,
 4};
 5
 6use crate::fq::Fq;
 7
 8pub type Fq3 = Fp3<Fq3Config>;
 9
10pub struct Fq3Config;
11
12impl Fp3Config for Fq3Config {
13    type Fp = Fq;
14
15    const NONRESIDUE: Fq = MontFp!("5");
16
17    const TWO_ADICITY: u32 = 34;
18
19    #[rustfmt::skip]
20    const TRACE_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    const QUADRATIC_NONRESIDUE_TO_T: Fq3 = Fq3::new(
38        MontFp!("154361449678783505076984156275977937654331103361174469632346230549735979552469642799720052"),
39        Fq::ZERO,
40        Fq::ZERO,
41    );
42
43    const FROBENIUS_COEFF_FP3_C1: &'static [Fq] = &[
44        Fq::ONE,
45        MontFp!("471738898967521029133040851318449165997304108729558973770077319830005517129946578866686956"),
46        MontFp!("4183387201740296620308398334599285547820769823264541783190415909159130177461911693276180"),
47    ];
48
49    const FROBENIUS_COEFF_FP3_C2: &'static [Fq] = &[
50        Self::FROBENIUS_COEFF_FP3_C1[0],
51        Self::FROBENIUS_COEFF_FP3_C1[2],
52        Self::FROBENIUS_COEFF_FP3_C1[1],
53    ];
54}