ark_bls12_381/fields/
fq12.rs

1use ark_ff::{fields::*, MontFp};
2
3use crate::*;
4
5pub type Fq12 = Fp12<Fq12Config>;
6
7#[derive(Clone, Copy)]
8pub struct Fq12Config;
9
10impl Fp12Config for Fq12Config {
11    type Fp6Config = Fq6Config;
12
13    const NONRESIDUE: Fq6 = Fq6::new(Fq2::ZERO, Fq2::ONE, Fq2::ZERO);
14
15    const FROBENIUS_COEFF_FP12_C1: &'static [Fq2] = &[
16        // Fp2::NONRESIDUE^(((q^0) - 1) / 6)
17        Fq2::new(
18            Fq::ONE,
19            Fq::ZERO,
20        ),
21        // Fp2::NONRESIDUE^(((q^1) - 1) / 6)
22        Fq2::new(
23            MontFp!("3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760"),
24            MontFp!("151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027"),
25        ),
26        // Fp2::NONRESIDUE^(((q^2) - 1) / 6)
27        Fq2::new(
28            MontFp!("793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620351"),
29            Fq::ZERO,
30        ),
31        // Fp2::NONRESIDUE^(((q^3) - 1) / 6)
32        Fq2::new(
33            MontFp!("2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530"),
34            MontFp!("1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257"),
35        ),
36        // Fp2::NONRESIDUE^(((q^4) - 1) / 6)
37        Fq2::new(
38            MontFp!("793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350"),
39            Fq::ZERO,
40        ),
41        // Fp2::NONRESIDUE^(((q^5) - 1) / 6)
42        Fq2::new(
43            MontFp!("3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557"),
44            MontFp!("877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230"),
45        ),
46        // Fp2::NONRESIDUE^(((q^6) - 1) / 6)
47        Fq2::new(
48            MontFp!("-1"),
49            Fq::ZERO,
50        ),
51        // Fp2::NONRESIDUE^(((q^7) - 1) / 6)
52        Fq2::new(
53            MontFp!("151655185184498381465642749684540099398075398968325446656007613510403227271200139370504932015952886146304766135027"),
54            MontFp!("3850754370037169011952147076051364057158807420970682438676050522613628423219637725072182697113062777891589506424760"),
55        ),
56        // Fp2::NONRESIDUE^(((q^8) - 1) / 6)
57        Fq2::new(
58            MontFp!("4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939436"),
59            Fq::ZERO,
60        ),
61        // Fp2::NONRESIDUE^(((q^9) - 1) / 6)
62        Fq2::new(
63            MontFp!("1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257"),
64            MontFp!("2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530"),
65        ),
66        // Fp2::NONRESIDUE^(((q^10) - 1) / 6)
67        Fq2::new(
68            MontFp!("4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437"),
69            Fq::ZERO,
70        ),
71        // Fp2::NONRESIDUE^(((q^11) - 1) / 6)
72        Fq2::new(
73            MontFp!("877076961050607968509681729531255177986764537961432449499635504522207616027455086505066378536590128544573588734230"),
74            MontFp!("3125332594171059424908108096204648978570118281977575435832422631601824034463382777937621250592425535493320683825557"),
75        ),
76    ];
77}