Merge #509: Fix algorithm selection in bench_ecmult
0f05173 Fix algorithm selection in bench_ecmult (Jonas Nick) Pull request description: Without this commit using an unknown argument results in a segmentation fault. Tree-SHA512: 85b8f977e62fa360ff6dc923bd86f08725c30e178d58f43d33cbd8eb69e54fa4ec76e4407624611a80554cf9961689bce6b216da735ac95b256d0d2f60fe3328
This commit is contained in:
commit
c71dd2c08f
@ -139,6 +139,7 @@ int main(int argc, char **argv) {
|
|||||||
secp256k1_gej* pubkeys_gej;
|
secp256k1_gej* pubkeys_gej;
|
||||||
size_t scratch_size;
|
size_t scratch_size;
|
||||||
|
|
||||||
|
data.ecmult_multi = secp256k1_ecmult_multi_var;
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
if(have_flag(argc, argv, "pippenger_wnaf")) {
|
if(have_flag(argc, argv, "pippenger_wnaf")) {
|
||||||
printf("Using pippenger_wnaf:\n");
|
printf("Using pippenger_wnaf:\n");
|
||||||
@ -146,9 +147,11 @@ int main(int argc, char **argv) {
|
|||||||
} else if(have_flag(argc, argv, "strauss_wnaf")) {
|
} else if(have_flag(argc, argv, "strauss_wnaf")) {
|
||||||
printf("Using strauss_wnaf:\n");
|
printf("Using strauss_wnaf:\n");
|
||||||
data.ecmult_multi = secp256k1_ecmult_strauss_batch_single;
|
data.ecmult_multi = secp256k1_ecmult_strauss_batch_single;
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "%s: unrecognized argument '%s'.\n", argv[0], argv[1]);
|
||||||
|
fprintf(stderr, "Use 'pippenger_wnaf', 'strauss_wnaf' or no argument to benchmark a combined algorithm.\n");
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
data.ecmult_multi = secp256k1_ecmult_multi_var;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate stuff */
|
/* Allocate stuff */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user