ark_bn254/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(Fq::ONE, Fq::ZERO),
18        // Fp2::NONRESIDUE^(((q^1) - 1) / 6)
19        Fq2::new(
20            MontFp!("8376118865763821496583973867626364092589906065868298776909617916018768340080"),
21            MontFp!(
22                "16469823323077808223889137241176536799009286646108169935659301613961712198316"
23            ),
24        ),
25        // Fp2::NONRESIDUE^(((q^2) - 1) / 6)
26        Fq2::new(
27            MontFp!(
28                "21888242871839275220042445260109153167277707414472061641714758635765020556617"
29            ),
30            Fq::ZERO,
31        ),
32        // Fp2::NONRESIDUE^(((q^3) - 1) / 6)
33        Fq2::new(
34            MontFp!(
35                "11697423496358154304825782922584725312912383441159505038794027105778954184319"
36            ),
37            MontFp!("303847389135065887422783454877609941456349188919719272345083954437860409601"),
38        ),
39        // Fp2::NONRESIDUE^(((q^4) - 1) / 6)
40        Fq2::new(
41            MontFp!(
42                "21888242871839275220042445260109153167277707414472061641714758635765020556616"
43            ),
44            Fq::ZERO,
45        ),
46        // Fp2::NONRESIDUE^(((q^5) - 1) / 6)
47        Fq2::new(
48            MontFp!("3321304630594332808241809054958361220322477375291206261884409189760185844239"),
49            MontFp!("5722266937896532885780051958958348231143373700109372999374820235121374419868"),
50        ),
51        // Fp2::NONRESIDUE^(((q^6) - 1) / 6)
52        Fq2::new(MontFp!("-1"), Fq::ZERO),
53        // Fp2::NONRESIDUE^(((q^7) - 1) / 6)
54        Fq2::new(
55            MontFp!(
56                "13512124006075453725662431877630910996106405091429524885779419978626457868503"
57            ),
58            MontFp!("5418419548761466998357268504080738289687024511189653727029736280683514010267"),
59        ),
60        // Fp2::NONRESIDUE^(((q^8) - 1) / 6)
61        Fq2::new(
62            MontFp!("2203960485148121921418603742825762020974279258880205651966"),
63            Fq::ZERO,
64        ),
65        // Fp2::NONRESIDUE^(((q^9) - 1) / 6)
66        Fq2::new(
67            MontFp!(
68                "10190819375481120917420622822672549775783927716138318623895010788866272024264"
69            ),
70            MontFp!(
71                "21584395482704209334823622290379665147239961968378104390343953940207365798982"
72            ),
73        ),
74        // Fp2::NONRESIDUE^(((q^10) - 1) / 6)
75        Fq2::new(
76            MontFp!("2203960485148121921418603742825762020974279258880205651967"),
77            Fq::ZERO,
78        ),
79        // Fp2::NONRESIDUE^(((q^11) - 1) / 6)
80        Fq2::new(
81            MontFp!(
82                "18566938241244942414004596690298913868373833782006617400804628704885040364344"
83            ),
84            MontFp!(
85                "16165975933942742336466353786298926857552937457188450663314217659523851788715"
86            ),
87        ),
88    ];
89}