Bitcoin Core 29.99.0
P2P Digital Currency
bench_ecmult.c
Go to the documentation of this file.
1/***********************************************************************
2 * Copyright (c) 2017 Pieter Wuille *
3 * Distributed under the MIT software license, see the accompanying *
4 * file COPYING or https://www.opensource.org/licenses/mit-license.php.*
5 ***********************************************************************/
6#include <stdio.h>
7#include <stdlib.h>
8
9#include "secp256k1.c"
10#include "../include/secp256k1.h"
11
12#include "util.h"
13#include "hash_impl.h"
14#include "field_impl.h"
15#include "group_impl.h"
16#include "scalar_impl.h"
17#include "ecmult_impl.h"
18#include "bench.h"
19
20#define POINTS 32768
21
22static void help(char **argv) {
23 printf("Benchmark EC multiplication algorithms\n");
24 printf("\n");
25 printf("Usage: %s <help|pippenger_wnaf|strauss_wnaf|simple>\n", argv[0]);
26 printf("The output shows the number of multiplied and summed points right after the\n");
27 printf("function name. The letter 'g' indicates that one of the points is the generator.\n");
28 printf("The benchmarks are divided by the number of points.\n");
29 printf("\n");
30 printf("default (ecmult_multi): picks pippenger_wnaf or strauss_wnaf depending on the\n");
31 printf(" batch size\n");
32 printf("pippenger_wnaf: for all batch sizes\n");
33 printf("strauss_wnaf: for all batch sizes\n");
34 printf("simple: multiply and sum each point individually\n");
35}
36
37typedef struct {
38 /* Setup once in advance */
47
48 /* Changes per benchmark */
49 size_t count;
51
52 /* Changes per benchmark iteration, used to pick different scalars and pubkeys
53 * in each run. */
54 size_t offset1;
55 size_t offset2;
56
57 /* Benchmark output. */
61
62/* Hashes x into [0, POINTS) twice and store the result in offset1 and offset2. */
63static void hash_into_offset(bench_data* data, size_t x) {
64 data->offset1 = (x * 0x537b7f6f + 0x8f66a481) % POINTS;
65 data->offset2 = (x * 0x7f6f537b + 0x6a1a8f49) % POINTS;
66}
67
68/* Check correctness of the benchmark by computing
69 * sum(outputs) ?= (sum(scalars_gen) + sum(seckeys)*sum(scalars))*G */
70static void bench_ecmult_teardown_helper(bench_data* data, size_t* seckey_offset, size_t* scalar_offset, size_t* scalar_gen_offset, int iters) {
71 int i;
72 secp256k1_gej sum_output, tmp;
73 secp256k1_scalar sum_scalars;
74
75 secp256k1_gej_set_infinity(&sum_output);
76 secp256k1_scalar_set_int(&sum_scalars, 0);
77 for (i = 0; i < iters; ++i) {
78 secp256k1_gej_add_var(&sum_output, &sum_output, &data->output[i], NULL);
79 if (scalar_gen_offset != NULL) {
80 secp256k1_scalar_add(&sum_scalars, &sum_scalars, &data->scalars[(*scalar_gen_offset+i) % POINTS]);
81 }
82 if (seckey_offset != NULL) {
83 secp256k1_scalar s = data->seckeys[(*seckey_offset+i) % POINTS];
84 secp256k1_scalar_mul(&s, &s, &data->scalars[(*scalar_offset+i) % POINTS]);
85 secp256k1_scalar_add(&sum_scalars, &sum_scalars, &s);
86 }
87 }
88 secp256k1_ecmult_gen(&data->ctx->ecmult_gen_ctx, &tmp, &sum_scalars);
89 CHECK(secp256k1_gej_eq_var(&tmp, &sum_output));
90}
91
92static void bench_ecmult_setup(void* arg) {
93 bench_data* data = (bench_data*)arg;
94 /* Re-randomize offset to ensure that we're using different scalars and
95 * group elements in each run. */
96 hash_into_offset(data, data->offset1);
97}
98
99static void bench_ecmult_gen(void* arg, int iters) {
100 bench_data* data = (bench_data*)arg;
101 int i;
102
103 for (i = 0; i < iters; ++i) {
104 secp256k1_ecmult_gen(&data->ctx->ecmult_gen_ctx, &data->output[i], &data->scalars[(data->offset1+i) % POINTS]);
105 }
106}
107
108static void bench_ecmult_gen_teardown(void* arg, int iters) {
109 bench_data* data = (bench_data*)arg;
110 bench_ecmult_teardown_helper(data, NULL, NULL, &data->offset1, iters);
111}
112
113static void bench_ecmult_const(void* arg, int iters) {
114 bench_data* data = (bench_data*)arg;
115 int i;
116
117 for (i = 0; i < iters; ++i) {
118 secp256k1_ecmult_const(&data->output[i], &data->pubkeys[(data->offset1+i) % POINTS], &data->scalars[(data->offset2+i) % POINTS]);
119 }
120}
121
122static void bench_ecmult_const_teardown(void* arg, int iters) {
123 bench_data* data = (bench_data*)arg;
124 bench_ecmult_teardown_helper(data, &data->offset1, &data->offset2, NULL, iters);
125}
126
127static void bench_ecmult_const_xonly(void* arg, int iters) {
128 bench_data* data = (bench_data*)arg;
129 int i;
130
131 for (i = 0; i < iters; ++i) {
132 const secp256k1_ge* pubkey = &data->pubkeys[(data->offset1+i) % POINTS];
133 const secp256k1_scalar* scalar = &data->scalars[(data->offset2+i) % POINTS];
134 int known_on_curve = 1;
135 secp256k1_ecmult_const_xonly(&data->output_xonly[i], &pubkey->x, NULL, scalar, known_on_curve);
136 }
137}
138
139static void bench_ecmult_const_xonly_teardown(void* arg, int iters) {
140 bench_data* data = (bench_data*)arg;
141 int i;
142
143 /* verify by comparing with x coordinate of regular ecmult result */
144 for (i = 0; i < iters; ++i) {
145 const secp256k1_gej* pubkey_gej = &data->pubkeys_gej[(data->offset1+i) % POINTS];
146 const secp256k1_scalar* scalar = &data->scalars[(data->offset2+i) % POINTS];
147 secp256k1_gej expected_gej;
148 secp256k1_ecmult(&expected_gej, pubkey_gej, scalar, NULL);
149 CHECK(secp256k1_gej_eq_x_var(&data->output_xonly[i], &expected_gej));
150 }
151}
152
153static void bench_ecmult_1p(void* arg, int iters) {
154 bench_data* data = (bench_data*)arg;
155 int i;
156
157 for (i = 0; i < iters; ++i) {
158 secp256k1_ecmult(&data->output[i], &data->pubkeys_gej[(data->offset1+i) % POINTS], &data->scalars[(data->offset2+i) % POINTS], NULL);
159 }
160}
161
162static void bench_ecmult_1p_teardown(void* arg, int iters) {
163 bench_data* data = (bench_data*)arg;
164 bench_ecmult_teardown_helper(data, &data->offset1, &data->offset2, NULL, iters);
165}
166
167static void bench_ecmult_0p_g(void* arg, int iters) {
168 bench_data* data = (bench_data*)arg;
169 int i;
170
171 for (i = 0; i < iters; ++i) {
172 secp256k1_ecmult(&data->output[i], NULL, &secp256k1_scalar_zero, &data->scalars[(data->offset1+i) % POINTS]);
173 }
174}
175
176static void bench_ecmult_0p_g_teardown(void* arg, int iters) {
177 bench_data* data = (bench_data*)arg;
178 bench_ecmult_teardown_helper(data, NULL, NULL, &data->offset1, iters);
179}
180
181static void bench_ecmult_1p_g(void* arg, int iters) {
182 bench_data* data = (bench_data*)arg;
183 int i;
184
185 for (i = 0; i < iters/2; ++i) {
186 secp256k1_ecmult(&data->output[i], &data->pubkeys_gej[(data->offset1+i) % POINTS], &data->scalars[(data->offset2+i) % POINTS], &data->scalars[(data->offset1+i) % POINTS]);
187 }
188}
189
190static void bench_ecmult_1p_g_teardown(void* arg, int iters) {
191 bench_data* data = (bench_data*)arg;
192 bench_ecmult_teardown_helper(data, &data->offset1, &data->offset2, &data->offset1, iters/2);
193}
194
195static void run_ecmult_bench(bench_data* data, int iters) {
196 char str[32];
197 sprintf(str, "ecmult_gen");
199 sprintf(str, "ecmult_const");
201 sprintf(str, "ecmult_const_xonly");
203 /* ecmult with non generator point */
204 sprintf(str, "ecmult_1p");
206 /* ecmult with generator point */
207 sprintf(str, "ecmult_0p_g");
209 /* ecmult with generator and non-generator point. The reported time is per point. */
210 sprintf(str, "ecmult_1p_g");
212}
213
214static int bench_ecmult_multi_callback(secp256k1_scalar* sc, secp256k1_ge* ge, size_t idx, void* arg) {
215 bench_data* data = (bench_data*)arg;
216 if (data->includes_g) ++idx;
217 if (idx == 0) {
218 *sc = data->scalars[data->offset1];
220 } else {
221 *sc = data->scalars[(data->offset1 + idx) % POINTS];
222 *ge = data->pubkeys[(data->offset2 + idx - 1) % POINTS];
223 }
224 return 1;
225}
226
227static void bench_ecmult_multi(void* arg, int iters) {
228 bench_data* data = (bench_data*)arg;
229
230 int includes_g = data->includes_g;
231 int iter;
232 int count = data->count;
233 iters = iters / data->count;
234
235 for (iter = 0; iter < iters; ++iter) {
236 data->ecmult_multi(&data->ctx->error_callback, data->scratch, &data->output[iter], data->includes_g ? &data->scalars[data->offset1] : NULL, bench_ecmult_multi_callback, arg, count - includes_g);
237 data->offset1 = (data->offset1 + count) % POINTS;
238 data->offset2 = (data->offset2 + count - 1) % POINTS;
239 }
240}
241
242static void bench_ecmult_multi_setup(void* arg) {
243 bench_data* data = (bench_data*)arg;
244 hash_into_offset(data, data->count);
245}
246
247static void bench_ecmult_multi_teardown(void* arg, int iters) {
248 bench_data* data = (bench_data*)arg;
249 int iter;
250 iters = iters / data->count;
251 /* Verify the results in teardown, to avoid doing comparisons while benchmarking. */
252 for (iter = 0; iter < iters; ++iter) {
253 secp256k1_gej tmp;
254 secp256k1_gej_add_var(&tmp, &data->output[iter], &data->expected_output[iter], NULL);
256 }
257}
258
259static void generate_scalar(uint32_t num, secp256k1_scalar* scalar) {
261 unsigned char c[10] = {'e', 'c', 'm', 'u', 'l', 't', 0, 0, 0, 0};
262 unsigned char buf[32];
263 int overflow = 0;
264 c[6] = num;
265 c[7] = num >> 8;
266 c[8] = num >> 16;
267 c[9] = num >> 24;
269 secp256k1_sha256_write(&sha256, c, sizeof(c));
271 secp256k1_scalar_set_b32(scalar, buf, &overflow);
272 CHECK(!overflow);
273}
274
275static void run_ecmult_multi_bench(bench_data* data, size_t count, int includes_g, int num_iters) {
276 char str[32];
277 size_t iters = 1 + num_iters / count;
278 size_t iter;
279
280 data->count = count;
281 data->includes_g = includes_g;
282
283 /* Compute (the negation of) the expected results directly. */
284 hash_into_offset(data, data->count);
285 for (iter = 0; iter < iters; ++iter) {
287 secp256k1_scalar total = data->scalars[(data->offset1++) % POINTS];
288 size_t i = 0;
289 for (i = 0; i + 1 < count; ++i) {
290 secp256k1_scalar_mul(&tmp, &data->seckeys[(data->offset2++) % POINTS], &data->scalars[(data->offset1++) % POINTS]);
291 secp256k1_scalar_add(&total, &total, &tmp);
292 }
293 secp256k1_scalar_negate(&total, &total);
294 secp256k1_ecmult(&data->expected_output[iter], NULL, &secp256k1_scalar_zero, &total);
295 }
296
297 /* Run the benchmark. */
298 if (includes_g) {
299 sprintf(str, "ecmult_multi_%ip_g", (int)count - 1);
300 } else {
301 sprintf(str, "ecmult_multi_%ip", (int)count);
302 }
304}
305
306int main(int argc, char **argv) {
308 int i, p;
309 size_t scratch_size;
310
311 int iters = get_iters(10000);
312
313 data.ecmult_multi = secp256k1_ecmult_multi_var;
314
315 if (argc > 1) {
316 if(have_flag(argc, argv, "-h")
317 || have_flag(argc, argv, "--help")
318 || have_flag(argc, argv, "help")) {
319 help(argv);
320 return EXIT_SUCCESS;
321 } else if(have_flag(argc, argv, "pippenger_wnaf")) {
322 printf("Using pippenger_wnaf:\n");
324 } else if(have_flag(argc, argv, "strauss_wnaf")) {
325 printf("Using strauss_wnaf:\n");
327 } else if(have_flag(argc, argv, "simple")) {
328 printf("Using simple algorithm:\n");
329 } else {
330 fprintf(stderr, "%s: unrecognized argument '%s'.\n\n", argv[0], argv[1]);
331 help(argv);
332 return EXIT_FAILURE;
333 }
334 }
335
338 if (!have_flag(argc, argv, "simple")) {
339 data.scratch = secp256k1_scratch_space_create(data.ctx, scratch_size);
340 } else {
341 data.scratch = NULL;
342 }
343
344 /* Allocate stuff */
345 data.scalars = malloc(sizeof(secp256k1_scalar) * POINTS);
346 data.seckeys = malloc(sizeof(secp256k1_scalar) * POINTS);
347 data.pubkeys = malloc(sizeof(secp256k1_ge) * POINTS);
348 data.pubkeys_gej = malloc(sizeof(secp256k1_gej) * POINTS);
349 data.expected_output = malloc(sizeof(secp256k1_gej) * (iters + 1));
350 data.output = malloc(sizeof(secp256k1_gej) * (iters + 1));
351 data.output_xonly = malloc(sizeof(secp256k1_fe) * (iters + 1));
352
353 /* Generate a set of scalars, and private/public keypairs. */
355 secp256k1_scalar_set_int(&data.seckeys[0], 1);
356 for (i = 0; i < POINTS; ++i) {
357 generate_scalar(i, &data.scalars[i]);
358 if (i) {
359 secp256k1_gej_double_var(&data.pubkeys_gej[i], &data.pubkeys_gej[i - 1], NULL);
360 secp256k1_scalar_add(&data.seckeys[i], &data.seckeys[i - 1], &data.seckeys[i - 1]);
361 }
362 }
363 secp256k1_ge_set_all_gej_var(data.pubkeys, data.pubkeys_gej, POINTS);
364
365
367 /* Initialize offset1 and offset2 */
369 run_ecmult_bench(&data, iters);
370
371 for (i = 1; i <= 8; ++i) {
372 run_ecmult_multi_bench(&data, i, 1, iters);
373 }
374
375 /* This is disabled with low count of iterations because the loop runs 77 times even with iters=1
376 * and the higher it goes the longer the computation takes(more points)
377 * So we don't run this benchmark with low iterations to prevent slow down */
378 if (iters > 2) {
379 for (p = 0; p <= 11; ++p) {
380 for (i = 9; i <= 16; ++i) {
381 run_ecmult_multi_bench(&data, i << p, 1, iters);
382 }
383 }
384 }
385
386 if (data.scratch != NULL) {
388 }
390 free(data.scalars);
391 free(data.pubkeys);
392 free(data.pubkeys_gej);
393 free(data.seckeys);
394 free(data.output_xonly);
395 free(data.output);
396 free(data.expected_output);
397
398 return EXIT_SUCCESS;
399}
static void bench_ecmult_const(void *arg, int iters)
Definition: bench_ecmult.c:113
static void bench_ecmult_gen_teardown(void *arg, int iters)
Definition: bench_ecmult.c:108
static int bench_ecmult_multi_callback(secp256k1_scalar *sc, secp256k1_ge *ge, size_t idx, void *arg)
Definition: bench_ecmult.c:214
static void bench_ecmult_teardown_helper(bench_data *data, size_t *seckey_offset, size_t *scalar_offset, size_t *scalar_gen_offset, int iters)
Definition: bench_ecmult.c:70
int main(int argc, char **argv)
Definition: bench_ecmult.c:306
static void bench_ecmult_const_xonly(void *arg, int iters)
Definition: bench_ecmult.c:127
static void bench_ecmult_setup(void *arg)
Definition: bench_ecmult.c:92
static void bench_ecmult_gen(void *arg, int iters)
Definition: bench_ecmult.c:99
static void generate_scalar(uint32_t num, secp256k1_scalar *scalar)
Definition: bench_ecmult.c:259
static void bench_ecmult_const_teardown(void *arg, int iters)
Definition: bench_ecmult.c:122
static void bench_ecmult_multi_setup(void *arg)
Definition: bench_ecmult.c:242
static void bench_ecmult_1p_g_teardown(void *arg, int iters)
Definition: bench_ecmult.c:190
static void bench_ecmult_1p(void *arg, int iters)
Definition: bench_ecmult.c:153
static void bench_ecmult_const_xonly_teardown(void *arg, int iters)
Definition: bench_ecmult.c:139
static void bench_ecmult_1p_teardown(void *arg, int iters)
Definition: bench_ecmult.c:162
static void bench_ecmult_multi(void *arg, int iters)
Definition: bench_ecmult.c:227
static void hash_into_offset(bench_data *data, size_t x)
Definition: bench_ecmult.c:63
static void help(char **argv)
Definition: bench_ecmult.c:22
static void bench_ecmult_0p_g_teardown(void *arg, int iters)
Definition: bench_ecmult.c:176
static void run_ecmult_bench(bench_data *data, int iters)
Definition: bench_ecmult.c:195
static void bench_ecmult_1p_g(void *arg, int iters)
Definition: bench_ecmult.c:181
static void bench_ecmult_0p_g(void *arg, int iters)
Definition: bench_ecmult.c:167
static void bench_ecmult_multi_teardown(void *arg, int iters)
Definition: bench_ecmult.c:247
#define POINTS
Definition: bench_ecmult.c:20
static void run_ecmult_multi_bench(bench_data *data, size_t count, int includes_g, int num_iters)
Definition: bench_ecmult.c:275
return EXIT_SUCCESS
static void run_benchmark(char *name, void(*benchmark)(void *), void(*setup)(void *), void(*teardown)(void *), void *data, int count, int iter)
Definition: bench.c:26
static int secp256k1_ecmult_multi_var(const secp256k1_callback *error_callback, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callback cb, void *cbdata, size_t n)
Multi-multiply: R = inp_g_sc * G + sum_i ni * Ai.
static void secp256k1_ecmult(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng)
Double multiply: R = na*A + ng*G.
static int secp256k1_ecmult_const_xonly(secp256k1_fe *r, const secp256k1_fe *n, const secp256k1_fe *d, const secp256k1_scalar *q, int known_on_curve)
Same as secp256k1_ecmult_const, but takes in an x coordinate of the base point only,...
static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *q)
Multiply: R = q*A (in constant-time for q)
static void secp256k1_ecmult_gen(const secp256k1_ecmult_gen_context *ctx, secp256k1_gej *r, const secp256k1_scalar *a)
Multiply with the generator: R = a*G.
#define STRAUSS_SCRATCH_OBJECTS
Definition: ecmult_impl.h:50
static int secp256k1_ecmult_strauss_batch_single(const secp256k1_callback *error_callback, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callback cb, void *cbdata, size_t n)
Definition: ecmult_impl.h:406
static size_t secp256k1_strauss_scratch_size(size_t n_points)
Definition: ecmult_impl.h:361
static int secp256k1_ecmult_pippenger_batch_single(const secp256k1_callback *error_callback, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callback cb, void *cbdata, size_t n)
Definition: ecmult_impl.h:718
int(* secp256k1_ecmult_multi_func)(const secp256k1_callback *error_callback, secp256k1_scratch *, secp256k1_gej *, const secp256k1_scalar *, secp256k1_ecmult_multi_callback cb, void *, size_t)
Definition: ecmult_impl.h:806
static int secp256k1_gej_eq_var(const secp256k1_gej *a, const secp256k1_gej *b)
Check two group elements (jacobian) for equality in variable time.
static void secp256k1_gej_double_var(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr)
Set r equal to the double of a.
static void secp256k1_gej_set_infinity(secp256k1_gej *r)
Set a group element (jacobian) equal to the point at infinity.
static int secp256k1_gej_is_infinity(const secp256k1_gej *a)
Check whether a group element is the point at infinity.
static void secp256k1_gej_add_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_gej *b, secp256k1_fe *rzr)
Set r equal to the sum of a and b.
static int secp256k1_gej_eq_x_var(const secp256k1_fe *x, const secp256k1_gej *a)
Compare the X coordinate of a group element (jacobian).
static void secp256k1_ge_set_all_gej_var(secp256k1_ge *r, const secp256k1_gej *a, size_t len)
Set group elements r[0:len] (affine) equal to group elements a[0:len] (jacobian).
static void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a)
Set a group element (jacobian) equal to another which is given in affine coordinates.
static const secp256k1_ge secp256k1_ge_const_g
Definition: group_impl.h:72
#define CHECK(cond)
Unconditional failure on condition failure.
Definition: util.h:35
Internal SHA-256 implementation.
Definition: sha256.cpp:68
void printf(FormatStringCheck< sizeof...(Args)> fmt, const Args &... args)
Format list of arguments to std::cout, according to the given format string.
Definition: tinyformat.h:1096
static void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *bin, int *overflow)
Set a scalar from a big endian byte array.
static void secp256k1_scalar_set_int(secp256k1_scalar *r, unsigned int v)
Set a scalar to an unsigned integer.
static int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b)
Add two scalars together (modulo the group order).
static void secp256k1_scalar_mul(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b)
Multiply two scalars (modulo the group order).
static void secp256k1_scalar_negate(secp256k1_scalar *r, const secp256k1_scalar *a)
Compute the complement of a scalar (modulo the group order).
static const secp256k1_scalar secp256k1_scalar_zero
Definition: scalar_impl.h:28
static int get_iters(int default_iters)
Definition: bench.h:170
static void print_output_table_header_row(void)
Definition: bench.h:179
static int have_flag(int argc, char **argv, char *flag)
Definition: bench.h:132
static void secp256k1_sha256_initialize(secp256k1_sha256 *hash)
static void secp256k1_sha256_finalize(secp256k1_sha256 *hash, unsigned char *out32)
static void secp256k1_sha256_write(secp256k1_sha256 *hash, const unsigned char *data, size_t size)
static void secp256k1_scratch_space_destroy(const secp256k1_context *ctx, secp256k1_scratch_space *scratch)
Definition: secp256k1.c:228
static secp256k1_scratch_space * secp256k1_scratch_space_create(const secp256k1_context *ctx, size_t max_size)
Definition: secp256k1.c:223
SECP256K1_API void secp256k1_context_destroy(secp256k1_context *ctx) SECP256K1_ARG_NONNULL(1)
Destroy a secp256k1 context object (created in dynamically allocated memory).
Definition: secp256k1.c:187
SECP256K1_API secp256k1_context * secp256k1_context_create(unsigned int flags) SECP256K1_WARN_UNUSED_RESULT
Create a secp256k1 context object (in dynamically allocated memory).
Definition: secp256k1.c:141
#define SECP256K1_CONTEXT_NONE
Context flags to pass to secp256k1_context_create, secp256k1_context_preallocated_size,...
Definition: secp256k1.h:214
secp256k1_scalar * seckeys
Definition: bench_ecmult.c:44
secp256k1_gej * output
Definition: bench_ecmult.c:58
secp256k1_gej * pubkeys_gej
Definition: bench_ecmult.c:43
size_t offset2
Definition: bench_ecmult.c:55
secp256k1_ecmult_multi_func ecmult_multi
Definition: bench_ecmult.c:46
int includes_g
Definition: bench_ecmult.c:50
size_t offset1
Definition: bench_ecmult.c:54
secp256k1_scratch_space * scratch
Definition: bench_ecmult.c:40
secp256k1_ge * pubkeys
Definition: bench_ecmult.c:42
size_t count
Definition: bench_ecmult.c:49
secp256k1_fe * output_xonly
Definition: bench_ecmult.c:59
secp256k1_scalar * scalars
Definition: bench_ecmult.c:41
secp256k1_gej * expected_output
Definition: bench_ecmult.c:45
This field implementation represents the value as 10 uint32_t limbs in base 2^26.
Definition: field_10x26.h:14
A group element in affine coordinates on the secp256k1 curve, or occasionally on an isomorphic curve ...
Definition: group.h:16
secp256k1_fe x
Definition: group.h:17
A group element of the secp256k1 curve, in jacobian coordinates.
Definition: group.h:28
A scalar modulo the group order of the secp256k1 curve.
Definition: scalar_4x64.h:13
static int count