ark-curves-cherry-picked/bls12_381/src/fields/fq12.rs
bls12_381/src/fields/fq12.rsRaw
1use crate::*;
2use ark_ff::{biginteger::BigInteger384, 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 // Fq2(u + 1)**(((q^0) - 1) / 6)
17 FQ2_ONE,
18 // Fq2(u + 1)**(((q^1) - 1) / 6)
19 field_new!(Fq2,
20 field_new!(Fq, BigInteger384([
21 0x7089552b319d465,
22 0xc6695f92b50a8313,
23 0x97e83cccd117228f,
24 0xa35baecab2dc29ee,
25 0x1ce393ea5daace4d,
26 0x8f2220fb0fb66eb,
27 ])),
28 field_new!(Fq, BigInteger384([
29 0xb2f66aad4ce5d646,
30 0x5842a06bfc497cec,
31 0xcf4895d42599d394,
32 0xc11b9cba40a8e8d0,
33 0x2e3813cbe5a0de89,
34 0x110eefda88847faf,
35 ])),
36 ),
37 // Fq2(u + 1)**(((q^2) - 1) / 6)
38 field_new!(Fq2,
39 field_new!(Fq, BigInteger384([
40 0xecfb361b798dba3a,
41 0xc100ddb891865a2c,
42 0xec08ff1232bda8e,
43 0xd5c13cc6f1ca4721,
44 0x47222a47bf7b5c04,
45 0x110f184e51c5f59,
46 ])),
47 FQ_ZERO,
48 ),
49 // Fq2(u + 1)**(((q^3) - 1) / 6)
50 field_new!(Fq2,
51 field_new!(Fq, BigInteger384([
52 0x3e2f585da55c9ad1,
53 0x4294213d86c18183,
54 0x382844c88b623732,
55 0x92ad2afd19103e18,
56 0x1d794e4fac7cf0b9,
57 0xbd592fc7d825ec8,
58 ])),
59 field_new!(Fq, BigInteger384([
60 0x7bcfa7a25aa30fda,
61 0xdc17dec12a927e7c,
62 0x2f088dd86b4ebef1,
63 0xd1ca2087da74d4a7,
64 0x2da2596696cebc1d,
65 0xe2b7eedbbfd87d2,
66 ])),
67 ),
68 // Fq2(u + 1)**(((q^4) - 1) / 6)
69 field_new!(Fq2,
70 field_new!(Fq, BigInteger384([
71 0x30f1361b798a64e8,
72 0xf3b8ddab7ece5a2a,
73 0x16a8ca3ac61577f7,
74 0xc26a2ff874fd029b,
75 0x3636b76660701c6e,
76 0x51ba4ab241b6160,
77 ])),
78 FQ_ZERO,
79 ),
80 // Fq2(u + 1)**(((q^5) - 1) / 6)
81 field_new!(Fq2,
82 field_new!(Fq, BigInteger384([
83 0x3726c30af242c66c,
84 0x7c2ac1aad1b6fe70,
85 0xa04007fbba4b14a2,
86 0xef517c3266341429,
87 0x95ba654ed2226b,
88 0x2e370eccc86f7dd,
89 ])),
90 field_new!(Fq, BigInteger384([
91 0x82d83cf50dbce43f,
92 0xa2813e53df9d018f,
93 0xc6f0caa53c65e181,
94 0x7525cf528d50fe95,
95 0x4a85ed50f4798a6b,
96 0x171da0fd6cf8eebd,
97 ])),
98 ),
99 // Fq2(u + 1)**(((q^6) - 1) / 6)
100 field_new!(Fq2,
101 field_new!(Fq, BigInteger384([
102 0x43f5fffffffcaaae,
103 0x32b7fff2ed47fffd,
104 0x7e83a49a2e99d69,
105 0xeca8f3318332bb7a,
106 0xef148d1ea0f4c069,
107 0x40ab3263eff0206,
108 ])),
109 FQ_ZERO,
110 ),
111 // Fq2(u + 1)**(((q^7) - 1) / 6)
112 field_new!(Fq2,
113 field_new!(Fq, BigInteger384([
114 0xb2f66aad4ce5d646,
115 0x5842a06bfc497cec,
116 0xcf4895d42599d394,
117 0xc11b9cba40a8e8d0,
118 0x2e3813cbe5a0de89,
119 0x110eefda88847faf,
120 ])),
121 field_new!(Fq, BigInteger384([
122 0x7089552b319d465,
123 0xc6695f92b50a8313,
124 0x97e83cccd117228f,
125 0xa35baecab2dc29ee,
126 0x1ce393ea5daace4d,
127 0x8f2220fb0fb66eb,
128 ])),
129 ),
130 // Fq2(u + 1)**(((q^8) - 1) / 6)
131 field_new!(Fq2,
132 field_new!(Fq, BigInteger384([
133 0xcd03c9e48671f071,
134 0x5dab22461fcda5d2,
135 0x587042afd3851b95,
136 0x8eb60ebe01bacb9e,
137 0x3f97d6e83d050d2,
138 0x18f0206554638741,
139 ])),
140 FQ_ZERO,
141 ),
142 // Fq2(u + 1)**(((q^9) - 1) / 6)
143 field_new!(Fq2,
144 field_new!(Fq, BigInteger384([
145 0x7bcfa7a25aa30fda,
146 0xdc17dec12a927e7c,
147 0x2f088dd86b4ebef1,
148 0xd1ca2087da74d4a7,
149 0x2da2596696cebc1d,
150 0xe2b7eedbbfd87d2,
151 ])),
152 field_new!(Fq, BigInteger384([
153 0x3e2f585da55c9ad1,
154 0x4294213d86c18183,
155 0x382844c88b623732,
156 0x92ad2afd19103e18,
157 0x1d794e4fac7cf0b9,
158 0xbd592fc7d825ec8,
159 ])),
160 ),
161 // Fq2(u + 1)**(((q^10) - 1) / 6)
162 field_new!(Fq2,
163 field_new!(Fq, BigInteger384([
164 0x890dc9e4867545c3,
165 0x2af322533285a5d5,
166 0x50880866309b7e2c,
167 0xa20d1b8c7e881024,
168 0x14e4f04fe2db9068,
169 0x14e56d3f1564853a,
170 ])),
171 FQ_ZERO,
172 ),
173 // Fq2(u + 1)**(((q^11) - 1) / 6)
174 field_new!(Fq2,
175 field_new!(Fq, BigInteger384([
176 0x82d83cf50dbce43f,
177 0xa2813e53df9d018f,
178 0xc6f0caa53c65e181,
179 0x7525cf528d50fe95,
180 0x4a85ed50f4798a6b,
181 0x171da0fd6cf8eebd,
182 ])),
183 field_new!(Fq, BigInteger384([
184 0x3726c30af242c66c,
185 0x7c2ac1aad1b6fe70,
186 0xa04007fbba4b14a2,
187 0xef517c3266341429,
188 0x95ba654ed2226b,
189 0x2e370eccc86f7dd,
190 ])),
191 ),
192 ];
193}