tests: Test secp256k1_ge_set_all_gej_var for all infinity inputs

This commit is contained in:
Tim Ruffing 2021-05-05 09:38:22 +02:00 committed by roconnor-blockstream
parent 45b6468d7e
commit 4a19668c37
1 changed files with 11 additions and 0 deletions

View File

@ -3115,6 +3115,17 @@ void test_ge(void) {
ge_equals_gej(&ge[i], &gej[i]); ge_equals_gej(&ge[i], &gej[i]);
} }
/* Test batch gej -> ge conversion with all infinities. */
for (i = 0; i < 4 * runs + 1; i++) {
secp256k1_gej_set_infinity(&gej[i]);
}
/* batch convert */
secp256k1_ge_set_all_gej_var(ge, gej, 4 * runs + 1);
/* check result */
for (i = 0; i < 4 * runs + 1; i++) {
CHECK(secp256k1_ge_is_infinity(&ge[i]));
}
free(ge); free(ge);
free(gej); free(gej);
} }