Merge #591: Make bench_internal obey secp256k1_fe_sqrt's contract wrt aliasing.

b76e45d Make bench_internal obey secp256k1_fe_sqrt's contract wrt aliasing. (Gregory Maxwell)

Pull request description:

  Bench_internal was previously incorrect but wasn't detected by -DVERIFY until PR #551.

Tree-SHA512: 5ecb9e3ba63ddf28cde4012154dbb1dda9b7178016d970dba58a4af20c31aa1ec3458ba2623541233fb16fceff7b3053054d6eee0229d0bfb6281d1a10554e9f
This commit is contained in:
Gregory Maxwell 2019-02-24 18:34:15 +00:00
commit 85d0e1bcce
No known key found for this signature in database
GPG Key ID: AC859362B0413BFA
1 changed files with 3 additions and 1 deletions

View File

@ -184,9 +184,11 @@ void bench_field_inverse_var(void* arg) {
void bench_field_sqrt(void* arg) {
int i;
bench_inv *data = (bench_inv*)arg;
secp256k1_fe t;
for (i = 0; i < 20000; i++) {
secp256k1_fe_sqrt(&data->fe_x, &data->fe_x);
t = data->fe_x;
secp256k1_fe_sqrt(&data->fe_x, &t);
secp256k1_fe_add(&data->fe_x, &data->fe_y);
}
}