Clearmatics Libff
0.1
C++ library for Finite Fields and Elliptic Curves
|
Go to the documentation of this file.
33 assert(
sizeof(mp_limb_t) == 8 ||
sizeof(mp_limb_t) == 4);
39 bigint_r(
"2586644260129690940106527336948935335363935127549146605398842"
40 "62666720468348340822774968888139573360124440321458177");
42 if (
sizeof(mp_limb_t) == 8) {
44 "661274283768726978163325701168662324052305289846649183196063154202"
45 "33909940404532140033099444330447428417853902114");
47 "157734475176213061358192738313701451942220138363611391489992831740"
48 "412033225490229541667992423878570205050777755168");
51 if (
sizeof(mp_limb_t) == 4) {
53 "661274283768726978163325701168662324052305289846649183196063154202"
54 "33909940404532140033099444330447428417853902114");
56 "157734475176213061358192738313701451942220138363611391489992831740"
57 "412033225490229541667992423878570205050777755168");
62 bigint_r(
"1293322130064845470053263668474467667681967563774573302699421"
63 "31333360234174170411387484444069786680062220160729088");
66 bigint_r(
"3675842578061421676390135839012792950148785745837396071634149"
67 "488243117337281387659330802195819009059");
69 bigint_r(
"1837921289030710838195067919506396475074392872918698035817074"
70 "744121558668640693829665401097909504529");
73 bw6_761_Fr(
"32863578547254505029601261939868325669770508939375122462904"
74 "745766352256812585773382134936404344547323199885654433");
77 bw6_761_Fr(
"33774956008227656219775876656288133547078610493828613777258"
78 "829345740556592044969439504850374928261397247202212840");
85 bigint_q(
"6891450384315732539396789682275657542479668912536150109513790"
86 "1602096234222434917360876831832894116876408645677537866134511"
87 "6175912055424775934951169912530159895160509937850885037254363"
88 "1423596795951899700429969112842764913119068299");
90 if (
sizeof(mp_limb_t) == 8) {
92 "410173710550729835244256131339319232418037181415529408988358678008"
93 "337131002543531210418765667118526087296627284304957029592342298086"
94 "677137781899438438783090920915449892454598380340650741080836049574"
95 "9428678951279422657716620863065");
97 "297415514632118086526834853439131925910825545338380841392089322640"
98 "624198677430665521626961318971291885148318712859327336480040754936"
99 "765047304839676586453060891603903912680899124818868997690823101153"
100 "644786484398736894438670450156");
104 if (
sizeof(mp_limb_t) == 4) {
106 "410173710550729835244256131339319232418037181415529408988358678008"
107 "337131002543531210418765667118526087296627284304957029592342298086"
108 "677137781899438438783090920915449892454598380340650741080836049574"
109 "9428678951279422657716620863065");
111 "297415514632118086526834853439131925910825545338380841392089322640"
112 "624198677430665521626961318971291885148318712859327336480040754936"
113 "765047304839676586453060891603903912680899124818868997690823101153"
114 "644786484398736894438670450156");
119 bigint_q(
"3445725192157866269698394841137828771239834456268075054756895"
120 "0801048117111217458680438415916447058438204322838768933067255"
121 "8087956027712387967475584956265079947580254968925442518627181"
122 "5711798397975949850214984556421382456559534149");
125 bigint_q(
"3445725192157866269698394841137828771239834456268075054756895"
126 "0801048117111217458680438415916447058438204322838768933067255"
127 "8087956027712387967475584956265079947580254968925442518627181"
128 "5711798397975949850214984556421382456559534149");
130 bigint_q(
"1722862596078933134849197420568914385619917228134037527378447"
131 "5400524058555608729340219207958223529219102161419384466533627"
132 "9043978013856193983737792478132539973790127484462721259313590"
133 "7855899198987974925107492278210691228279767074");
136 bw6_761_Fq(
"68914503843157325393967896822756575424796689125361501095137"
137 "90160209623422243491736087683183289411687640864567753786613"
138 "45116175912055424775934951169912530159895160509937850885037"
139 "2543631423596795951899700429969112842764913119068298");
142 bw6_761_Fq(
"68914503843157325393967896822756575424796689125361501095137"
143 "90160209623422243491736087683183289411687640864567753786613"
144 "45116175912055424775934951169912530159895160509937850885037"
145 "2543631423596795951899700429969112842764913119068298");
150 "1636446854262954003249141699409548889559206196373633220512096143268984"
151 "5397014880568641901171928604942518055908462554673180677727867910667998"
152 "4663099143697116161447047621868304705520956489172590015220902479424161"
153 "5633521368602921395669003930971333893630420619714613478078837246039873"
154 "3124493326270446151854198371345979937646860351442184846671768256523932"
155 "2945704382553665794724881767934477627356011124130848888786345848916593"
156 "9567481576923242781572039862743001907835119097653682898829629358506603"
157 "8893699793468601168791027807574316427084928535262789988925129164000203"
158 "2048904566729137025370148302740362549750397891505412715221417910833483"
159 "274288268810463328915955262815220574933205354950574767449");
162 "1636446854262954003249141699409548889559206196373633220512096143268984"
163 "5397014880568641901171928604942518055908462554673180677727867910667998"
164 "4663099143697116161447047621868304705520956489172590015220902479424161"
165 "5633521368602921395669003930971333893630420619714613478078837246039873"
166 "3124493326270446151854198371345979937646860351442184846671768256523932"
167 "2945704382553665794724881767934477627356011124130848888786345848916593"
168 "9567481576923242781572039862743001907835119097653682898829629358506603"
169 "8893699793468601168791027807574316427084928535262789988925129164000203"
170 "2048904566729137025370148302740362549750397891505412715221417910833483"
171 "274288268810463328915955262815220574933205354950574767449");
173 "8182234271314770016245708497047744447796030981868166102560480716344922"
174 "6985074402843209505859643024712590279542312773365903388639339553339992"
175 "3315495718485580807235238109341523527604782445862950076104512397120807"
176 "8167606843014606978345019654856669468152103098573067390394186230199366"
177 "5622466631352230759270991856729899688234301757210924233358841282619661"
178 "4728521912768328973624408839672388136780055620654244443931729244582969"
179 "7837407884616213907860199313715009539175595488268414494148146792533019"
180 "4468498967343005843955139037871582135424642676313949944625645820001016"
181 "0244522833645685126850741513701812748751989457527063576107089554167416"
182 "37144134405231664457977631407610287466602677475287383724");
186 bw6_761_Fq(
"68914503843157325393967896822756575424796689125361501095137"
187 "90160209623422243491736087683183289411687640864567753786613"
188 "45116175912055424775934951169912530159895160509937850885037"
189 "2543631423596795951899700429969112842764913119068298"),
193 bw6_761_Fq(
"68914503843157325393967896822756575424796689125361501095137"
194 "90160209623422243491736087683183289411687640864567753786613"
195 "45116175912055424775934951169912530159895160509937850885037"
196 "2543631423596795951899700429969112842764913119068295");
200 bw6_761_Fq(
"68914503843157325393967896822756575424796689125361501095137"
201 "90160209623422243491736087683183289411687640864567753786613"
202 "45116175912055424775934951169912530159895160509937850885037"
203 "2543631423596795951899700429969112842764913119068298"),
208 bw6_761_Fq(
"49224645602255232421181789425750803910820025302323243810630"
209 "48548642823052024664478336818169867474395270858391911405337"
210 "70724773573982666493944449046954210939153048282672820358254"
211 "9674992333383150446779312029624171857054392282775648");
213 bw6_761_Fq(
"19689858240902092972786107397005771513976663823038257284507"
214 "41611566800370218827257750865013421937292370006175842381275"
215 "74391402338072758281990502122958319220742112227265030526782"
216 "2868639090213645505120388400344940985710520836292650");
219 bw6_761_Fq(
"19689858240902092972786107397005771513976663823038257284507"
220 "41611566800370218827257750865013421937292370006175842381275"
221 "74391402338072758281990502122958319220742112227265030526782"
222 "2868639090213645505120388400344940985710520836292650");
224 bw6_761_Fq(
"49224645602255232421181789425750803910820025302323243810630"
225 "48548642823052024664478336818169867474395270858391911405337"
226 "70724773573982666493944449046954210939153048282672820358254"
227 "9674992333383150446779312029624171857054392282775648");
231 bw6_761_Fq(
"68914503843157325393967896822756575424796689125361501095137"
232 "90160209623422243491736087683183289411687640864567753786613"
233 "45116175912055424775934951169912530159895160509937850885037"
234 "2543631423596795951899700429969112842764913119068295");
237 bw6_761_Fq(
"49224645602255232421181789425750803910820025302323243810630"
238 "48548642823052024664478336818169867474395270858391911405337"
239 "70724773573982666493944449046954210939153048282672820358254"
240 "9674992333383150446779312029624171857054392282775649");
242 bw6_761_Fq(
"49224645602255232421181789425750803910820025302323243810630"
243 "48548642823052024664478336818169867474395270858391911405337"
244 "70724773573982666493944449046954210939153048282672820358254"
245 "9674992333383150446779312029624171857054392282775648");
247 bw6_761_Fq(
"68914503843157325393967896822756575424796689125361501095137"
248 "90160209623422243491736087683183289411687640864567753786613"
249 "45116175912055424775934951169912530159895160509937850885037"
250 "2543631423596795951899700429969112842764913119068298");
252 bw6_761_Fq(
"19689858240902092972786107397005771513976663823038257284507"
253 "41611566800370218827257750865013421937292370006175842381275"
254 "74391402338072758281990502122958319220742112227265030526782"
255 "2868639090213645505120388400344940985710520836292650");
257 bw6_761_Fq(
"19689858240902092972786107397005771513976663823038257284507"
258 "41611566800370218827257750865013421937292370006175842381275"
259 "74391402338072758281990502122958319220742112227265030526782"
260 "2868639090213645505120388400344940985710520836292651");
268 bw6_761_Fq(
"68914503843157325393967896822756575424796689125361501095137"
269 "90160209623422243491736087683183289411687640864567753786613"
270 "45116175912055424775934951169912530159895160509937850885037"
271 "2543631423596795951899700429969112842764913119068298");
275 bw6_761_Fq(
"68914503843157325393967896822756575424796689125361501095137"
276 "90160209623422243491736087683183289411687640864567753786613"
277 "45116175912055424775934951169912530159895160509937850885037"
278 "2543631423596795951899700429969112842764913119068295");
288 bw6_761_Fq(
"62387722575946793680321456936228128387790058097608247331387"
289 "87810501188623461307351759238099287535516224314149266511977"
290 "13214082863595094002179048950761175436631780181109081136794"
291 "5064510304504157188661901055903167026722666149426237"),
292 bw6_761_Fq(
"21017351265208974239115045622158349511481275559133679971627"
293 "89335052900271653517958562461315794228241561913734371411178"
294 "22693652768320387955309393418595047097184897208532179795812"
295 "4416462268292467002957525517188485984766314758624099"),
304 "2664243587933581668398767770148807386775111827005265065594210250231297"
305 "7592501693353047140953112195348280268661194876");
369 bw6_761_Fq(
"64453329105969793360358881527740716268988861397741013649339"
370 "48236926875073754470830732273879639675437155036544153105017"
371 "72959260056063167855429956276229474392791242909663615640117"
372 "1909259073181112518725201388196280039960074422214428"),
373 bw6_761_Fq(
"56292365808953971938692216344454738775758653474108026394695"
374 "34015951552119346305989993003963171041825980447937581532149"
375 "72605680357108252243146746187917218885078195819486220416605"
376 "630144001533548163105316661692978285266378674355041"),
385 "2664243587933581668398767770148807386775111827005265065594210250231297"
386 "7592501693353047140953112195348280268661194869");
450 bigint_q(
"880904806456922042166256752416502360955572640081583800319");
static Fp3_model< n, modulus > nqr_to_t
nqr^t
static std::vector< size_t > fixed_base_exp_window_table
static my_Fp Frobenius_coeffs_c1[3]
non_residue^((modulus^i-1)/3) for i=0,1,2
static bw6_761_G2 G2_zero
static bigint< 3 *n > euler
(modulus^3-1)/2
bool bw6_761_ate_is_loop_count_neg
bigint< bls12_377_q_limbs > bw6_761_modulus_r
static size_t s
modulus^3 = 2^s * t + 1
static bw6_761_G1 G1_zero
Fp_model< bw6_761_r_limbs, bw6_761_modulus_r > bw6_761_Fr
static bw6_761_Fq coeff_b
static std::vector< size_t > wnaf_window_table
static Fp_model< n, modulus > nqr
a quadratic nonresidue
Fp_model< bw6_761_q_limbs, bw6_761_modulus_q > bw6_761_Fq
static const Fp_model< n, modulus > & zero()
static bigint< 3 *n > t_minus_1_over_2
(t-1)/2
static bigint< n > t
with t odd
static size_t s
modulus = 2^s * t + 1
bigint< bw6_761_q_limbs > bw6_761_ate_loop_count2
static bigint< n > euler
(modulus-1)/2
static bool modulus_is_valid()
bigint< bw6_761_q_limbs > bw6_761_modulus_q
static const Fp_model< n, modulus > & one()
bool bw6_761_final_exponent_is_z_neg
static bw6_761_Fq coeff_a
static bw6_761_Fq coeff_b
static my_Fp Frobenius_coeffs_c2[3]
non_residue^((2*modulus^i-2)/3) for i=0,1,2
static bigint< n > t_minus_1_over_2
(t-1)/2
void init_bw6_761_params()
static Fp3_model< n, modulus > nqr
a quadratic nonresidue in Fp3
static void static_init()
static Fp_model< n, modulus > root_of_unity
generator^((modulus-1)/2^s)
static std::vector< size_t > fixed_base_exp_window_table
bw6_761_Fq bw6_761_coeff_b
static bigint< h_limbs > h
static my_Fp Frobenius_coeffs_c1[6]
non_residue^((modulus^i-1)/6) for i=0,1,2,3,4,5
bigint< bw6_761_q_limbs > bw6_761_final_exponent_z
static Fp_model< n, modulus > nqr_to_t
nqr^t
static Fp_model< n, modulus > multiplicative_generator
generator of Fp^*
static bigint< h_limbs > h
static bw6_761_Fq coeff_a
static mp_limb_t inv
-modulus^(-1) mod W, where W = 2^(word size)
bw6_761_Fq bw6_761_twist_coeff_b
static bigint< n > Rsquared
R^2, where R = W^k, where k = ??
static std::vector< size_t > wnaf_window_table
Fp3_model< bw6_761_q_limbs, bw6_761_modulus_q > bw6_761_Fq3
static bigint< n > Rcubed
R^3.
static bigint< 3 *n > t
with t odd
bigint< bw6_761_q_limbs > bw6_761_ate_loop_count1