Description
Motivated by #1793 (comment)
In this change, the get_iters function was updated to print an error message and then return 0.
In the functions that use get_iters they print the help text and then EXIT_FAILURE
Before
0secp256k1 $ SECP256K1_BENCH_ITERS=abc ./build/bin/bench
1
2Benchmark , Min(us) , Avg(us) , Max(us)
3
4Floating point exception (core dumped)
After
0secp256k1 $ SECP256K1_BENCH_ITERS=abc ./build/bin/bench
1
2Invalid value for SECP256K1_BENCH_ITERS must be a positive integer: abc
3
4Benchmarks the following algorithms:
5 - ECDSA signing/verification
6 - ECDH key exchange (optional module)
7 - Schnorr signatures (optional module)
8 - ElligatorSwift (optional module)
9
10The default number of iterations for each benchmark is 20000. This can be
11customized using the SECP256K1_BENCH_ITERS environment variable.
12
13Usage: ./bench [args]
14By default, all benchmarks will be run.
15args:
16 help : display this help and exit
17 ecdsa : all ECDSA algorithms--sign, verify, recovery (if enabled)
18 ecdsa_sign : ECDSA siging algorithm
19 ecdsa_verify : ECDSA verification algorithm
20 ec : all EC public key algorithms (keygen)
21 ec_keygen : EC public key generation
22 ecdh : ECDH key exchange algorithm
23 schnorrsig : all Schnorr signature algorithms (sign, verify)
24 schnorrsig_sign : Schnorr sigining algorithm
25 schnorrsig_verify : Schnorr verification algorithm
26 ellswift : all ElligatorSwift benchmarks (encode, decode, keygen, ecdh)
27 ellswift_encode : ElligatorSwift encoding
28 ellswift_decode : ElligatorSwift decoding
29 ellswift_keygen : ElligatorSwift key generation
30 ellswift_ecdh : ECDH on ElligatorSwift keys