Clearmatics Libff
0.1
C++ library for Finite Fields and Elliptic Curves
|
Go to the documentation of this file.
38 sizeof(mp_limb_t) == 8 ||
39 sizeof(mp_limb_t) == 4);
44 "4400416034343698204186575808495617");
46 if (
sizeof(mp_limb_t) == 8) {
48 bigint_r(
"944936681149208446651664254269745548490766851729442924617"
49 "792859073125903783");
51 bigint_r(
"586654854594384522748989487204024472040386810557878410528"
52 "1690076696998248512");
55 if (
sizeof(mp_limb_t) == 4) {
57 bigint_r(
"944936681149208446651664254269745548490766851729442924617"
58 "792859073125903783");
60 bigint_r(
"586654854594384522748989487204024472040386810557878410528"
61 "1690076696998248512");
66 "2200208017171849102093287904247808");
69 "81540058820840996586704275553141814055101440848469862132140264610111");
71 "40770029410420498293352137776570907027550720424234931066070132305055");
74 alt_bn128_Fr(
"191032190679217139442913928276920700361456519573292863153"
75 "05642004821462161904");
78 alt_bn128_Fr(
"191032190679217139442913928276920700361456519573292863153"
79 "05642004821462161904");
85 "1157297823662689037894645226208583");
87 if (
sizeof(mp_limb_t) == 8) {
89 bigint_q(
"309661650298370392384356793683737445173554096841907652877"
90 "1170197431451843209");
92 bigint_q(
"149217865411596481859481527385630809590936198385102451777"
93 "10943249661917737183");
96 if (
sizeof(mp_limb_t) == 4) {
98 bigint_q(
"309661650298370392384356793683737445173554096841907652877"
99 "1170197431451843209");
101 bigint_q(
"149217865411596481859481527385630809590936198385102451777"
102 "10943249661917737183");
107 "5578648911831344518947322613104291");
109 alt_bn128_Fq::t = bigint_q(
"10944121435919637611123202872628637544348155578"
110 "648911831344518947322613104291");
112 bigint_q(
"5472060717959818805561601436314318772174077789324455915672259"
116 alt_bn128_Fq(
"218882428718392752222464057452572750886963111572978236626"
117 "89037894645226208582");
120 alt_bn128_Fq(
"218882428718392752222464057452572750886963111572978236626"
121 "89037894645226208582");
126 "2395475880083114212209940226083393703996261582655504112182239011270350"
127 "4684318911872392052590971893598559411615740655013091812781706979347432"
131 "2994344850103892765262425282604242129995326978319380140227798764087938"
132 "0855398639840490065738714866998199264519675818766364765977133724184290"
135 "1497172425051946382631212641302121064997663489159690070113899382043969"
136 "0427699319920245032869357433499099632259837909383182382988566862092145"
139 alt_bn128_Fq(
"218882428718392752222464057452572750886963111572978236626"
140 "89037894645226208582");
143 alt_bn128_Fq(
"503350371626262426731249255837998268717520073493487759859"
144 "9011485707452665730"),
145 alt_bn128_Fq(
"314498342015008975724433667930697407966947188435857772134"
146 "235984660852259084"));
149 alt_bn128_Fq(
"218882428718392752222464057452572750886963111572978236626"
150 "89037894645226208582");
159 alt_bn128_Fq(
"215754636382808430103983242694308260992690442743472168272"
160 "12613867836435027261"),
161 alt_bn128_Fq(
"103076015958737097001522842738161122640692301306164367556"
162 "25194854815875713954"));
164 alt_bn128_Fq(
"218882428718392752200424452601091531672777074144720616417"
165 "14758635765020556616"),
168 alt_bn128_Fq(
"377200088191985377643369518671385823900907359381719577177"
169 "3381919316419345261"),
170 alt_bn128_Fq(
"223659549596724518828170124820318179512106890260586122785"
171 "5261137820944008926"));
174 "2203960485148121921418603742825762020974279258880205651966"),
177 alt_bn128_Fq(
"184290212234778536576607920343698658391145044464312347263"
178 "92080002137598044644"),
179 alt_bn128_Fq(
"934404577999832033381242022323798102950601212407552567920"
180 "8581902008406485703"));
184 alt_bn128_Fq(
"258191134446700933526731111546880309955166560507619674086"
185 "7805258568234346338"),
186 alt_bn128_Fq(
"199377569717756479879959321699293419943146406529649494483"
187 "13374472400716661030"));
190 "2203960485148121921418603742825762020974279258880205651966"),
193 alt_bn128_Fq(
"532447920244990354272678339550621448192825776240064327978"
194 "0343368557297135718"),
195 alt_bn128_Fq(
"162089003807376930849194951273343879813937264198568887999"
196 "17914180988844123039"));
198 alt_bn128_Fq(
"218882428718392752200424452601091531672777074144720616417"
199 "14758635765020556616"),
202 alt_bn128_Fq(
"139818523249223623442523112342822575072163877898209836420"
203 "40889267519694726527"),
204 alt_bn128_Fq(
"762982839116520937157738419325082020168425524177380907714"
205 "6787135900891633097"));
214 alt_bn128_Fq(
"837611886576382149658397386762636409258990606586829877690"
215 "9617916018768340080"),
216 alt_bn128_Fq(
"164698233230778082238891372411765367990092866461081699356"
217 "59301613961712198316"));
219 alt_bn128_Fq(
"218882428718392752200424452601091531672777074144720616417"
220 "14758635765020556617"),
223 alt_bn128_Fq(
"116974234963581543048257829225847253129123834411595050387"
224 "94027105778954184319"),
225 alt_bn128_Fq(
"303847389135065887422783454877609941456349188919719272345"
226 "083954437860409601"));
228 alt_bn128_Fq(
"218882428718392752200424452601091531672777074144720616417"
229 "14758635765020556616"),
232 alt_bn128_Fq(
"332130463059433280824180905495836122032247737529120626188"
233 "4409189760185844239"),
234 alt_bn128_Fq(
"572226693789653288578005195895834823114337370010937299937"
235 "4820235121374419868"));
237 alt_bn128_Fq(
"218882428718392752222464057452572750886963111572978236626"
238 "89037894645226208582"),
241 alt_bn128_Fq(
"135121240060754537256624318776309109961064050914295248857"
242 "79419978626457868503"),
243 alt_bn128_Fq(
"541841954876146699835726850408073828968702451118965372702"
244 "9736280683514010267"));
247 "2203960485148121921418603742825762020974279258880205651966"),
250 alt_bn128_Fq(
"101908193754811209174206228226725497757839277161383186238"
251 "95010788866272024264"),
252 alt_bn128_Fq(
"215843954827042093348236222903796651472399619683781043903"
253 "43953940207365798982"));
256 "2203960485148121921418603742825762020974279258880205651967"),
259 alt_bn128_Fq(
"185669382412449424140045966902989138683738337820066174008"
260 "04628704885040364344"),
261 alt_bn128_Fq(
"161659759339427423364663537862989268575529374571884506633"
262 "14217659523851788715"));
274 alt_bn128_Fq(
"215754636382808430103983242694308260992690442743472168272"
275 "12613867836435027261"),
276 alt_bn128_Fq(
"103076015958737097001522842738161122640692301306164367556"
277 "25194854815875713954"));
279 alt_bn128_Fq(
"282156518219453684454815956169350265935961718524412036707"
280 "8079554186484126554"),
281 alt_bn128_Fq(
"350584376791155637868703030998424884554024350989925964101"
282 "3678093033130930403"));
360 alt_bn128_Fq(
"10857046999023057135944570762232829481370756359578518"
361 "086990519993285655852781"),
362 alt_bn128_Fq(
"11559732032986387107991004021392285783925812861821192"
363 "530917403151452391805634")),
365 alt_bn128_Fq(
"84956539231234314176049732474892724384181905872636001"
366 "48770280649306958101930"),
367 alt_bn128_Fq(
"40823678758634336813322034031454355683168513275934012"
368 "08105741076214120093531")),
383 "4257914179612981679871602714643921549");
443 "5524842336132240963126171267831731470973821037629576541888827343141969"
444 "1083990754121397450276154062981700960854865468034362770115382944674781"
445 "0907373256841551006201639677726139946029199968412598804882391702273019"
446 "0836532720475663165843655597764930274954582383739028759376599435048732"
447 "2055416155052592630230333174746351564471187665317712957830319109590090"
448 "9191624817826566688241804408081892785725967931714097716709526092261278"
449 "0719525601711114440720492291235650574837501614600243533462841672824527"
450 "5621766233552881351913980829117053907212538123081572907154486160275093"
451 "6964829313608137325426383735122175229541155376346436093930287402089517"
452 "4269731789175697133847480818272554725769374714961957527271882614356332"
453 "7123871013173609629979816885292554054934233077527987700678435480142224"
454 "972257378356168517961881648003769500551542616236243107224563832474448"
static bigint< 2 *n > euler
(modulus^2-1)/2
alt_bn128_Fq2 alt_bn128_twist_mul_by_q_Y
static Fp2_model< n, modulus > nqr_to_t
nqr^t
static bigint< 2 *n > t_minus_1_over_2
(t-1)/2
static const Fp2_model< n, modulus > & one()
static Fp_model< n, modulus > nqr
a quadratic nonresidue
static const Fp_model< n, modulus > & zero()
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
static bigint< n > t
with t odd
static size_t s
modulus = 2^s * t + 1
static bigint< h_limbs > h
static alt_bn128_Fq coeff_b
static bigint< n > euler
(modulus-1)/2
static alt_bn128_G1 G1_zero
alt_bn128_Fq2 alt_bn128_twist_coeff_b
bigint< alt_bn128_r_limbs > alt_bn128_modulus_r
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()
alt_bn128_Fq2 alt_bn128_twist_mul_by_q_X
Fp2_model inverse() const
static const Fp_model< n, modulus > & one()
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 > fixed_base_exp_window_table
static alt_bn128_G2 G2_zero
bigint< alt_bn128_q_limbs > alt_bn128_final_exponent_z
static Fp2_model< n, modulus > nqr
a quadratic nonresidue in Fp2
alt_bn128_Fq alt_bn128_twist_mul_by_b_c1
Fp2_model< alt_bn128_q_limbs, alt_bn128_modulus_q > alt_bn128_Fq2
bigint< 12 *alt_bn128_q_limbs > alt_bn128_final_exponent
static void static_init()
bool alt_bn128_final_exponent_is_z_neg
bool alt_bn128_ate_is_loop_count_neg
static alt_bn128_G1 G1_one
static bigint< n > t_minus_1_over_2
(t-1)/2
static bigint< h_limbs > h
static alt_bn128_Fq2 coeff_a
bigint< alt_bn128_q_limbs > alt_bn128_modulus_q
Fp_model< alt_bn128_r_limbs, alt_bn128_modulus_r > alt_bn128_Fr
static void static_init()
static std::vector< size_t > fixed_base_exp_window_table
static Fp_model< n, modulus > root_of_unity
generator^((modulus-1)/2^s)
Fp_model< alt_bn128_q_limbs, alt_bn128_modulus_q > alt_bn128_Fq
static alt_bn128_Fq coeff_a
static Fp_model< n, modulus > nqr_to_t
nqr^t
static Fp_model< n, modulus > multiplicative_generator
generator of Fp^*
static std::vector< size_t > wnaf_window_table
static std::vector< size_t > wnaf_window_table
static mp_limb_t inv
-modulus^(-1) mod W, where W = 2^(word size)
alt_bn128_Fq alt_bn128_twist_mul_by_b_c0
static my_Fp2 non_residue
static alt_bn128_G2 G2_one
static const Fp2_model< n, modulus > & zero()
void init_alt_bn128_params()
static alt_bn128_Fq2 coeff_b
static bigint< n > Rsquared
R^2, where R = W^k, where k = ??
static bigint< 2 *n > t
with t odd
bigint< alt_bn128_q_limbs > alt_bn128_ate_loop_count
static size_t s
modulus^2 = 2^s * t + 1
alt_bn128_Fq alt_bn128_coeff_b
static bigint< n > Rcubed
R^3.
alt_bn128_Fq2 alt_bn128_twist