mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-14 13:52:36 -03:00
Signed/unsigned comparisons in tests.
This commit is contained in:
parent
850562e3f1
commit
3276e7d4e2
1 changed files with 6 additions and 6 deletions
12
src/tests.c
12
src/tests.c
|
@ -502,13 +502,13 @@ void run_field_inv_all(void) {
|
||||||
secp256k1_fe_inv_all(0, xi, x);
|
secp256k1_fe_inv_all(0, xi, x);
|
||||||
for (int i=0; i<count; i++) {
|
for (int i=0; i<count; i++) {
|
||||||
size_t len = (secp256k1_rand32() & 15) + 1;
|
size_t len = (secp256k1_rand32() & 15) + 1;
|
||||||
for (int j=0; j<len; j++)
|
for (size_t j=0; j<len; j++)
|
||||||
random_fe_non_zero(&x[j]);
|
random_fe_non_zero(&x[j]);
|
||||||
secp256k1_fe_inv_all(len, xi, x);
|
secp256k1_fe_inv_all(len, xi, x);
|
||||||
for (int j=0; j<len; j++)
|
for (size_t j=0; j<len; j++)
|
||||||
CHECK(check_fe_inverse(&x[j], &xi[j]));
|
CHECK(check_fe_inverse(&x[j], &xi[j]));
|
||||||
secp256k1_fe_inv_all(len, xii, xi);
|
secp256k1_fe_inv_all(len, xii, xi);
|
||||||
for (int j=0; j<len; j++)
|
for (size_t j=0; j<len; j++)
|
||||||
CHECK(check_fe_equal(&x[j], &xii[j]));
|
CHECK(check_fe_equal(&x[j], &xii[j]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -519,13 +519,13 @@ void run_field_inv_all_var(void) {
|
||||||
secp256k1_fe_inv_all_var(0, xi, x);
|
secp256k1_fe_inv_all_var(0, xi, x);
|
||||||
for (int i=0; i<count; i++) {
|
for (int i=0; i<count; i++) {
|
||||||
size_t len = (secp256k1_rand32() & 15) + 1;
|
size_t len = (secp256k1_rand32() & 15) + 1;
|
||||||
for (int j=0; j<len; j++)
|
for (size_t j=0; j<len; j++)
|
||||||
random_fe_non_zero(&x[j]);
|
random_fe_non_zero(&x[j]);
|
||||||
secp256k1_fe_inv_all_var(len, xi, x);
|
secp256k1_fe_inv_all_var(len, xi, x);
|
||||||
for (int j=0; j<len; j++)
|
for (size_t j=0; j<len; j++)
|
||||||
CHECK(check_fe_inverse(&x[j], &xi[j]));
|
CHECK(check_fe_inverse(&x[j], &xi[j]));
|
||||||
secp256k1_fe_inv_all_var(len, xii, xi);
|
secp256k1_fe_inv_all_var(len, xii, xi);
|
||||||
for (int j=0; j<len; j++)
|
for (size_t j=0; j<len; j++)
|
||||||
CHECK(check_fe_equal(&x[j], &xii[j]));
|
CHECK(check_fe_equal(&x[j], &xii[j]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue