Clearmatics Libff
0.1
C++ library for Finite Fields and Elliptic Curves
|
Go to the documentation of this file.
56 assert(
sizeof(mp_limb_t) == 8 ||
sizeof(mp_limb_t) == 4);
61 "335154063827935233455917409239041");
64 if (
sizeof(mp_limb_t) == 8) {
66 bigint_r(
"508595941311779472113692600146818027278633330499214071737"
67 "745792929336755579");
69 bigint_r(
"271718748542331355632020787121653842635320109739890963908"
70 "6937135091399607628");
74 if (
sizeof(mp_limb_t) == 4) {
76 bigint_r(
"508595941311779472113692600146818027278633330499214071737"
77 "745792929336755579");
79 bigint_r(
"271718748542331355632020787121653842635320109739890963908"
80 "6937135091399607628");
85 "667577031913967616727958704619520");
88 "60001509534603559531609739528203892656505753216962260608619555");
90 "30000754767301779765804869764101946328252876608481130304309777");
93 bls12_377_Fr(
"806515965671681287737496751840327346652143269366181061997"
94 "9959746626482506078");
97 bls12_377_Fr(
"692488678884788206012306650822351907723216075069845241107"
98 "1850219367055984476");
108 bigint_q(
"2586644260129690940106527336948935335363935127549146605398842"
109 "62666720468348340822774968888139573360124440321458177");
111 if (
sizeof(mp_limb_t) == 8) {
113 "661274283768726978163325701168662324052305289846649183196063154202"
114 "33909940404532140033099444330447428417853902114");
116 "157734475176213061358192738313701451942220138363611391489992831740"
117 "412033225490229541667992423878570205050777755168");
120 if (
sizeof(mp_limb_t) == 4) {
122 "661274283768726978163325701168662324052305289846649183196063154202"
123 "33909940404532140033099444330447428417853902114");
125 "157734475176213061358192738313701451942220138363611391489992831740"
126 "412033225490229541667992423878570205050777755168");
132 bigint_q(
"1293322130064845470053263668474467667681967563774573302699421"
133 "31333360234174170411387484444069786680062220160729088");
136 bigint_q(
"3675842578061421676390135839012792950148785745837396071634149"
137 "488243117337281387659330802195819009059");
139 bigint_q(
"1837921289030710838195067919506396475074392872918698035817074"
140 "744121558668640693829665401097909504529");
143 "3286357854725450502960126193986832566977050893937512246290474576635225"
144 "6812585773382134936404344547323199885654433");
149 "3377495600822765621977587665628813354707861049382861377725882934574055"
150 "6592044969439504850374928261397247202212840");
155 "3345364264230938125808962594624906928800576001088647925307095745329795"
156 "7116339370141113413635838485065209570299254148838549585056123015878375"
157 "0227249980418287852270900634666582330594333230337725133219903165601670"
158 "27213559780081664");
161 "4754048552841450893153254632217264839938161459668674418291936583116517"
162 "6127142572882339399080590404004751647874022280630227875599477749628896"
163 "1383541476974255391881599499962735436887347234371823579436839914935817"
166 "2377024276420725446576627316108632419969080729834337209145968291558258"
167 "8063571286441169699540295202002375823937011140315113937799738874814448"
168 "0691770738487127695940799749981367718443673617185911789718419957467908"
175 "2586644260129690940106527336948935335363935127549146605398842626667204"
176 "68348340822774968888139573360124440321458172");
181 "257286236321774568987262729980034669694531728092793737444525294935"
182 "421142460394028155736019924956637466133519652786"));
185 "2586644260129690940106527336948935335363935127549146605398842626667204"
186 "68348340822774968888139573360124440321458176");
195 bls12_377_Fq(
"809496482649127194085583631406374772648452947207104994781"
196 "37287262712535938301461879813459410946"),
199 bls12_377_Fq(
"809496482649127194085583631406374772648452947207104994781"
200 "37287262712535938301461879813459410945"),
204 "258664426012969094010652733694893533536393512754914660539884262666"
205 "720468348340822774968888139573360124440321458176"),
209 "258664426012969093929703085429980814127835149614277183275038967946"
210 "009968870203535512256352201271898244626862047231"),
214 "258664426012969093929703085429980814127835149614277183275038967946"
215 "009968870203535512256352201271898244626862047232"),
220 bls12_377_Fq(
"809496482649127194085583631406374772648452947207104994781"
221 "37287262712535938301461879813459410945"),
225 "258664426012969093929703085429980814127835149614277183275038967946"
226 "009968870203535512256352201271898244626862047231"),
231 bls12_377_Fq(
"809496482649127194085583631406374772648452947207104994781"
232 "37287262712535938301461879813459410945"),
236 "258664426012969093929703085429980814127835149614277183275038967946"
237 "009968870203535512256352201271898244626862047231"),
247 "929493452202778647586249605064731826779530489092832489809601043817"
248 "95901929519566951595905490535835115111760994353"),
251 bls12_377_Fq(
"809496482649127194085583631406374772648452947207104994781"
252 "37287262712535938301461879813459410946"),
256 "216465761340224619389371505802605247630151569547285782856803747159"
257 "100223055385581585702401816380679166954762214499"),
260 bls12_377_Fq(
"809496482649127194085583631406374772648452947207104994781"
261 "37287262712535938301461879813459410945"),
265 "123516416119946754630746545296132064952198520638002533875843642777"
266 "304321125866014634106496325844844051843001220146"),
270 "258664426012969094010652733694893533536393512754914660539884262666"
271 "720468348340822774968888139573360124440321458176"),
275 "165715080792691229252027773188420350858440463845631411558924158284"
276 "924566418821255823372982649037525009328560463824"),
280 "258664426012969093929703085429980814127835149614277183275038967946"
281 "009968870203535512256352201271898244626862047231"),
285 "421986646727444746212812278922882859062419432076288776830805155076"
286 "20245292955241189266486323192680957485559243678"),
290 "258664426012969093929703085429980814127835149614277183275038967946"
291 "009968870203535512256352201271898244626862047232"),
295 "135148009893022339379906188398761468584194992116912126664040619889"
296 "416147222474808140862391813728516072597320238031"),
311 bls12_377_Fq(
"809496482649127194085583631406374772648452947207104994781"
312 "37287262712535938301461879813459410946"),
316 "216465761340224619389371505802605247630151569547285782856803747159"
317 "100223055385581585702401816380679166954762214499"),
326 "819379993731509642399382555734659482399886715026479765942196956448"
327 "55304257327692006745978603320413799295628339695"),
329 "241266749859715473739788878240585681733927191168601896383759122102"
330 "112907357779751001206799952863815012735208165030"),
346 bls12_377_Fq(
"809496482649127194085583631406374772648452947207104994781"
347 "37287262712535938301461879813459410945");
349 bigint_r(
"91893752504881257701523279626832445441");
353 bigint_r(
"5285428838741532253824584287042945485047145357130994810877");
355 "5579135224678387240478846790990709250936401022990388020368969649878761"
356 "5734938123558571181995209025075818229621722");
358 "1743638558335201382296667234848353486892365850134605544446097301206037"
359 "41818916846216286948728983932214174344518655");
433 "11158394577469511644391122625782382343446874024988304283774515"
434 "1039122196680777376765707574547389190084887628324746"),
436 "12906698065670308551815730115433521588608211252437868655587316"
437 "1080604845924984124025594590925548060469686767592854")),
440 "16886329972466897718302994134759646260897838050396510334100391"
441 "8678547611204475537878680436662916294540335494194722"),
443 "23389249728747576225133535189361842960367292146986439276751455"
444 "2093535653615809913098097380147379993375817193725968")),
453 "7923214915284317143930293550643874566881017850177945424769256759165301"
454 "4366169332282092779667740924864672894786184047614126306918357646745593"
461 untwist_frobenius_twist_w * untwist_frobenius_twist_w;
471 bigint_r(
"293634935485640680722085584138834120318524213360527933441");
473 bigint_r(
"30631250834960419227450344600217059328");
543 "1062352101801986048825403166370756842879803290512381119957121396507912"
544 "9114663661236359849629341526275899063345613340067081670062620727617884"
545 "1374877547391501474912045595142051864923855902722089344674614449446527"
546 "1100516937116825006879082077612477209563023710218982773301998983506333"
547 "4551453893534663070786533932633573962932272563471643288531959637300817"
548 "0702655374295064848809909810690412694053835028896773570820128072985299"
549 "3111812442856905982234628974507740157013415744497327152098177404714691"
550 "8354408632568723153146248333028827919406785654402107153546667815607201"
551 "4885908324782254034441364093498774812681548179045413406141732619497724"
552 "0306092432436686172324518261985938925498500823600746581427336149713413"
553 "8868945580557938161335670207544906643574043606819537336472235809927599"
554 "6281232753142880061708040445602386764639316393397119131110809745825932"
555 "2813870415432059977568309560404130900019702541996812571801831180595931"
556 "5220036948621879242495199408833915486421612374480018459896018440926235"
557 "2618246549569323848592604793727760229797367342216290972978901546921944"
558 "4152846277021881179562447110897237757369083391323126054783555085125681"
559 "7740247389770320334698430697237343583761719223414894063451411431859122"
560 "7384883115800054127650702518101599918971109363249432325268702807248769"
561 "46523218213525646968094720");
static bigint< 2 *n > euler
(modulus^2-1)/2
bls12_377_Fq12 bls12_377_g2_untwist_frobenius_twist_v_inverse
static bls12_377_G2 G2_one
static bls12_377_Fq coeff_b
static Fp2_model< n, modulus > nqr_to_t
nqr^t
static bls12_377_G1 G1_zero
bls12_377_Fq12 bls12_377_g2_untwist_frobenius_twist_v
static Fp6_3over2_model< n, modulus > one()
static Fp6_3over2_model< n, modulus > zero()
bool bls12_377_final_exponent_is_z_neg
static bigint< 2 *n > t_minus_1_over_2
(t-1)/2
bigint< bls12_377_r_limbs > bls12_377_modulus_r
static const Fp2_model< n, modulus > & one()
bigint< bls12_377_q_limbs > bls12_377_ate_loop_count
bigint< bls12_377_q_limbs > bls12_377_final_exponent_z
static Fp_model< n, modulus > nqr
a quadratic nonresidue
static const Fp_model< n, modulus > & zero()
Fp_model< bls12_377_r_limbs, bls12_377_modulus_r > bls12_377_Fr
static Fp2_model< n, modulus > non_residue
static Fp2_model< n, modulus > Frobenius_coeffs_c1[12]
non_residue^((modulus^i-1)/6) for i=0,...,11
bigint< 12 *bls12_377_q_limbs > bls12_377_final_exponent
static bigint< n > t
with t odd
static size_t s
modulus = 2^s * t + 1
Fp12_2over3over2_model< bls12_377_q_limbs, bls12_377_modulus_q > bls12_377_Fq12
static bls12_377_Fq coeff_a
bls12_377_Fq bls12_377_coeff_b
Fp_model< bls12_377_q_limbs, bls12_377_modulus_q > bls12_377_Fq
static bigint< h_limbs > h
bls12_377_Fq2 bls12_377_twist_coeff_b
bls12_377_Fq12 bls12_377_g2_untwist_frobenius_twist_w_3
bls12_377_Fq2 bls12_377_twist_mul_by_q_X
static bigint< n > euler
(modulus-1)/2
static my_Fp2 Frobenius_coeffs_c1[6]
non_residue^((modulus^i-1)/3) for i=0,1,2,3,4,5
static bool modulus_is_valid()
bigint< bls12_377_r_limbs > bls12_377_g1_safe_subgroup_check_c1
Fp2_model inverse() const
static const Fp_model< n, modulus > & one()
bls12_377_Fq bls12_377_g1_proof_of_safe_subgroup_non_member_y
static std::vector< size_t > fixed_base_exp_window_table
static my_Fp2 Frobenius_coeffs_c2[6]
non_residue^((2*modulus^i-2)/3) for i=0,1,2,3,4,5
static my_Fp Frobenius_coeffs_c1[2]
non_residue^((modulus^i-1)/2) for i=0,1
static std::vector< size_t > wnaf_window_table
static Fp2_model< n, modulus > nqr
a quadratic nonresidue in Fp2
bls12_377_Fq2 bls12_377_twist_mul_by_q_Y
Fp12_2over3over2_model inverse() const
bls12_377_Fq bls12_377_g1_proof_of_safe_subgroup_non_member_x
bigint< bls12_377_r_limbs > bls12_377_g2_mul_by_cofactor_h2_1
Fp2_model< bls12_377_q_limbs, bls12_377_modulus_q > bls12_377_Fq2
static void static_init()
static bigint< n > t_minus_1_over_2
(t-1)/2
bigint< bls12_377_r_limbs > bls12_377_g1_proof_of_safe_subgroup_w
bls12_377_Fq bls12_377_twist_mul_by_b_c1
static void static_init()
static Fp_model< n, modulus > root_of_unity
generator^((modulus-1)/2^s)
bigint< bls12_377_r_limbs > bls12_377_trace_of_frobenius
#define bls12_377_modulus_q
bls12_377_Fq2 bls12_377_twist
static bls12_377_G2 G2_zero
bls12_377_Fq12 bls12_377_g2_untwist_frobenius_twist_w_3_inverse
static Fp_model< n, modulus > nqr_to_t
nqr^t
static Fp_model< n, modulus > multiplicative_generator
generator of Fp^*
static bls12_377_G1 G1_one
static bls12_377_Fq2 coeff_b
static mp_limb_t inv
-modulus^(-1) mod W, where W = 2^(word size)
bool bls12_377_ate_is_loop_count_neg
void init_bls12_377_params()
static my_Fp2 non_residue
static bls12_377_Fq2 coeff_a
static std::vector< size_t > fixed_base_exp_window_table
bigint< bls12_377_r_limbs > bls12_377_g2_mul_by_cofactor_h2_0
static const Fp2_model< n, modulus > & zero()
static bigint< n > Rsquared
R^2, where R = W^k, where k = ??
static std::vector< size_t > wnaf_window_table
static bigint< h_limbs > h
static bigint< 2 *n > t
with t odd
bls12_377_Fq bls12_377_twist_mul_by_b_c0
static size_t s
modulus^2 = 2^s * t + 1
static bigint< n > Rcubed
R^3.
bls12_377_Fq12 bls12_377_g2_untwist_frobenius_twist_w
bls12_377_Fq bls12_377_g1_endomorphism_beta