ark-curves-cherry-picked/bn254/src/fields/fq12.rs
bn254/src/fields/fq12.rsRaw
1use super::*;
2use ark_ff::{biginteger::BigInteger256, field_new, fields::*};
3
4pub type Fq12 = Fp12<Fq12Parameters>;
5
6#[derive(Clone, Copy)]
7pub struct Fq12Parameters;
8
9impl Fp12Parameters for Fq12Parameters {
10 type Fp6Params = Fq6Parameters;
11
12 const NONRESIDUE: Fq6 = field_new!(Fq6, FQ2_ZERO, FQ2_ONE, FQ2_ZERO);
13
14 #[rustfmt::skip]
15 const FROBENIUS_COEFF_FP12_C1: &'static [Fq2] = &[
16 // Fp2::NONRESIDUE^(((q^0) - 1) / 6)
17 FQ2_ONE,
18 // Fp2::NONRESIDUE^(((q^1) - 1) / 6)
19 field_new!(Fq2,
20 field_new!(Fq, BigInteger256([
21 0xaf9ba69633144907,
22 0xca6b1d7387afb78a,
23 0x11bded5ef08a2087,
24 0x02f34d751a1f3a7c,
25 ])),
26 field_new!(Fq, BigInteger256([
27 0xa222ae234c492d72,
28 0xd00f02a4565de15b,
29 0xdc2ff3a253dfc926,
30 0x10a75716b3899551,
31 ])),
32 ),
33 // Fp2::NONRESIDUE^(((q^2) - 1) / 6)
34 field_new!(Fq2,
35 field_new!(Fq, BigInteger256([
36 0xca8d800500fa1bf2,
37 0xf0c5d61468b39769,
38 0x0e201271ad0d4418,
39 0x04290f65bad856e6,
40 ])),
41 FQ_ZERO,
42 ),
43 // Fp2::NONRESIDUE^(((q^3) - 1) / 6)
44 field_new!(Fq2,
45 field_new!(Fq, BigInteger256([
46 0x365316184e46d97d,
47 0x0af7129ed4c96d9f,
48 0x659da72fca1009b5,
49 0x08116d8983a20d23,
50 ])),
51 field_new!(Fq, BigInteger256([
52 0xb1df4af7c39c1939,
53 0x3d9f02878a73bf7f,
54 0x9b2220928caf0ae0,
55 0x26684515eff054a6,
56 ])),
57 ),
58 // Fp2::NONRESIDUE^(((q^4) - 1) / 6)
59 field_new!(Fq2,
60 field_new!(Fq, BigInteger256([
61 0x3350c88e13e80b9c,
62 0x7dce557cdb5e56b9,
63 0x6001b4b8b615564a,
64 0x2682e617020217e0,
65 ])),
66 FQ_ZERO,
67 ),
68 // Fp2::NONRESIDUE^(((q^5) - 1) / 6)
69 field_new!(Fq2,
70 field_new!(Fq, BigInteger256([
71 0x86b76f821b329076,
72 0x408bf52b4d19b614,
73 0x53dfb9d0d985e92d,
74 0x051e20146982d2a7,
75 ])),
76 field_new!(Fq, BigInteger256([
77 0x0fbc9cd47752ebc7,
78 0x6d8fffe33415de24,
79 0xbef22cf038cf41b9,
80 0x15c0edff3c66bf54,
81 ])),
82 ),
83 // Fp2::NONRESIDUE^(((q^6) - 1) / 6)
84 field_new!(Fq2,
85 field_new!(Fq, BigInteger256([
86 0x68c3488912edefaa,
87 0x8d087f6872aabf4f,
88 0x51e1a24709081231,
89 0x2259d6b14729c0fa,
90 ])),
91 FQ_ZERO,
92 ),
93 // Fp2::NONRESIDUE^(((q^7) - 1) / 6)
94 field_new!(Fq2,
95 field_new!(Fq, BigInteger256([
96 0x8c84e580a568b440,
97 0xcd164d1de0c21302,
98 0xa692585790f737d5,
99 0x2d7100fdc71265ad,
100 ])),
101 field_new!(Fq, BigInteger256([
102 0x99fdddf38c33cfd5,
103 0xc77267ed1213e931,
104 0xdc2052142da18f36,
105 0x1fbcf75c2da80ad7,
106 ])),
107 ),
108 // Fp2::NONRESIDUE^(((q^8) - 1) / 6)
109 field_new!(Fq2,
110 field_new!(Fq, BigInteger256([
111 0x71930c11d782e155,
112 0xa6bb947cffbe3323,
113 0xaa303344d4741444,
114 0x2c3b3f0d26594943,
115 ])),
116 FQ_ZERO,
117 ),
118 // Fp2::NONRESIDUE^(((q^9) - 1) / 6)
119 field_new!(Fq2,
120 field_new!(Fq, BigInteger256([
121 0x05cd75fe8a3623ca,
122 0x8c8a57f293a85cee,
123 0x52b29e86b7714ea8,
124 0x2852e0e95d8f9306,
125 ])),
126 field_new!(Fq, BigInteger256([
127 0x8a41411f14e0e40e,
128 0x59e26809ddfe0b0d,
129 0x1d2e2523f4d24d7d,
130 0x09fc095cf1414b83,
131 ])),
132 ),
133 // Fp2::NONRESIDUE^(((q^10) - 1) / 6)
134 field_new!(Fq2,
135 field_new!(Fq, BigInteger256([
136 0x08cfc388c494f1ab,
137 0x19b315148d1373d4,
138 0x584e90fdcb6c0213,
139 0x09e1685bdf2f8849,
140 ])),
141 FQ_ZERO,
142 ),
143 // Fp2::NONRESIDUE^(((q^11) - 1) / 6)
144 field_new!(Fq2,
145 field_new!(Fq, BigInteger256([
146 0xb5691c94bd4a6cd1,
147 0x56f575661b581478,
148 0x64708be5a7fb6f30,
149 0x2b462e5e77aecd82,
150 ])),
151 field_new!(Fq, BigInteger256([
152 0x2c63ef42612a1180,
153 0x29f16aae345bec69,
154 0xf95e18c648b216a4,
155 0x1aa36073a4cae0d4,
156 ])),
157 ),
158 ];
159}