Modified bench_scalar_split so it won't get optimized out

This commit is contained in:
Elichai Turkel 2019-10-28 16:27:44 +02:00
parent 73a30c6b58
commit 362bb25608
No known key found for this signature in database
GPG Key ID: 9383CDE9E8E66A7F
1 changed files with 4 additions and 4 deletions

View File

@ -95,14 +95,14 @@ void bench_scalar_mul(void* arg) {
#ifdef USE_ENDOMORPHISM
void bench_scalar_split(void* arg) {
int i;
int i, j = 0;
bench_inv *data = (bench_inv*)arg;
for (i = 0; i < 20000; i++) {
secp256k1_scalar l, r;
secp256k1_scalar_split_lambda(&l, &r, &data->scalar_x);
secp256k1_scalar_add(&data->scalar_x, &data->scalar_x, &data->scalar_y);
secp256k1_scalar_split_lambda(&data->scalar_x, &data->scalar_y, &data->scalar_x);
j += secp256k1_scalar_add(&data->scalar_x, &data->scalar_x, &data->scalar_y);
}
CHECK(j <= 20000);
}
#endif