Merge #490: Disambiguate bench functions and types

1f46d60 Disambiguate bench functions and types (Pieter Wuille)

Pull request description:

  This fixes a Travis failure.

Tree-SHA512: ff601507c0bf286e29d202f3a4419977e394416e200c86848417040c79aad683399f6be1cc90b18842f4f7f2d928ef6f7562c1372bd4d4a258705819149972b2
This commit is contained in:
Pieter Wuille 2017-12-21 14:05:36 -08:00
commit 02f5001dfc
No known key found for this signature in database
GPG Key ID: A636E97631F767E0
2 changed files with 8 additions and 8 deletions

View File

@ -15,11 +15,11 @@ typedef struct {
secp256k1_context *ctx;
secp256k1_pubkey point;
unsigned char scalar[32];
} bench_ecdh;
} bench_ecdh_data;
static void bench_ecdh_setup(void* arg) {
int i;
bench_ecdh *data = (bench_ecdh*)arg;
bench_ecdh_data *data = (bench_ecdh_data*)arg;
const unsigned char point[] = {
0x03,
0x54, 0x94, 0xc1, 0x5d, 0x32, 0x09, 0x97, 0x06,
@ -39,7 +39,7 @@ static void bench_ecdh_setup(void* arg) {
static void bench_ecdh(void* arg) {
int i;
unsigned char res[32];
bench_ecdh *data = (bench_ecdh*)arg;
bench_ecdh_data *data = (bench_ecdh_data*)arg;
for (i = 0; i < 20000; i++) {
CHECK(secp256k1_ecdh(data->ctx, res, &data->point, data->scalar) == 1);
@ -47,7 +47,7 @@ static void bench_ecdh(void* arg) {
}
int main(void) {
bench_ecdh data;
bench_ecdh_data data;
run_benchmark("ecdh", bench_ecdh, bench_ecdh_setup, NULL, &data, 10, 20000);
return 0;

View File

@ -13,11 +13,11 @@ typedef struct {
secp256k1_context *ctx;
unsigned char msg[32];
unsigned char sig[64];
} bench_recover;
} bench_recover_data;
void bench_recover(void* arg) {
int i;
bench_recover *data = (bench_recover*)arg;
bench_recover_data *data = (bench_recover_data*)arg;
secp256k1_pubkey pubkey;
unsigned char pubkeyc[33];
@ -38,7 +38,7 @@ void bench_recover(void* arg) {
void bench_recover_setup(void* arg) {
int i;
bench_recover *data = (bench_recover*)arg;
bench_recover_data *data = (bench_recover_data*)arg;
for (i = 0; i < 32; i++) {
data->msg[i] = 1 + i;
@ -49,7 +49,7 @@ void bench_recover_setup(void* arg) {
}
int main(void) {
bench_recover data;
bench_recover_data data;
data.ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY);