4
4
* file COPYING or https://www.opensource.org/licenses/mit-license.php.*
5
5
***********************************************************************/
6
6
7
- #include <string.h>
8
- #include <stdlib.h>
7
+ #ifndef SECP256K1_MODULE_SCHNORRSIG_BENCH_H
8
+ #define SECP256K1_MODULE_SCHNORRSIG_BENCH_H
9
9
10
-
11
- #include "../include/secp256k1.h"
12
- #include "../include/secp256k1_schnorrsig.h"
13
- #include "util.h"
14
- #include "bench.h"
10
+ #include "../../../include/secp256k1_schnorrsig.h"
15
11
16
12
#define MSGLEN 32
17
13
@@ -49,10 +45,9 @@ void bench_schnorrsig_verify(void* arg, int iters) {
49
45
}
50
46
}
51
47
52
- int main ( void ) {
48
+ void run_schnorrsig_bench ( int iters ) {
53
49
int i ;
54
50
bench_schnorrsig_data data ;
55
- int iters = get_iters (10000 );
56
51
57
52
data .ctx = secp256k1_context_create (SECP256K1_CONTEXT_VERIFY | SECP256K1_CONTEXT_SIGN );
58
53
data .keypairs = (const secp256k1_keypair * * )malloc (iters * sizeof (secp256k1_keypair * ));
@@ -86,7 +81,6 @@ int main(void) {
86
81
CHECK (secp256k1_xonly_pubkey_serialize (data .ctx , pk_char , & pk ) == 1 );
87
82
}
88
83
89
- print_output_table_header_row ();
90
84
run_benchmark ("schnorrsig_sign" , bench_schnorrsig_sign , NULL , NULL , (void * ) & data , 10 , iters );
91
85
run_benchmark ("schnorrsig_verify" , bench_schnorrsig_verify , NULL , NULL , (void * ) & data , 10 , iters );
92
86
@@ -102,5 +96,6 @@ int main(void) {
102
96
free (data .sigs );
103
97
104
98
secp256k1_context_destroy (data .ctx );
105
- return 0 ;
106
99
}
100
+
101
+ #endif
0 commit comments