free the ctx at the end of bench_ecdh
This commit is contained in:
parent
e9fccd4de1
commit
02dd5f1bbb
@ -28,8 +28,6 @@ static void bench_ecdh_setup(void* arg) {
|
|||||||
0xa2, 0xba, 0xd1, 0x84, 0xf8, 0x83, 0xc6, 0x9f
|
0xa2, 0xba, 0xd1, 0x84, 0xf8, 0x83, 0xc6, 0x9f
|
||||||
};
|
};
|
||||||
|
|
||||||
/* create a context with no capabilities */
|
|
||||||
data->ctx = secp256k1_context_create(SECP256K1_FLAGS_TYPE_CONTEXT);
|
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
data->scalar[i] = i + 1;
|
data->scalar[i] = i + 1;
|
||||||
}
|
}
|
||||||
@ -49,6 +47,11 @@ static void bench_ecdh(void* arg) {
|
|||||||
int main(void) {
|
int main(void) {
|
||||||
bench_ecdh_data data;
|
bench_ecdh_data data;
|
||||||
|
|
||||||
|
/* create a context with no capabilities */
|
||||||
|
data.ctx = secp256k1_context_create(SECP256K1_FLAGS_TYPE_CONTEXT);
|
||||||
|
|
||||||
run_benchmark("ecdh", bench_ecdh, bench_ecdh_setup, NULL, &data, 10, 20000);
|
run_benchmark("ecdh", bench_ecdh, bench_ecdh_setup, NULL, &data, 10, 20000);
|
||||||
|
|
||||||
|
secp256k1_context_destroy(data.ctx);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user