Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/tests.c
Show First 20 Lines • Show All 2,234 Lines • ▼ Show 20 Lines | /* Test batch gej -> ge conversion with and without known z ratios. */ | ||||
} | } | ||||
free(ge_set_all); | free(ge_set_all); | ||||
free(zr); | free(zr); | ||||
} | } | ||||
/* Test batch gej -> ge conversion with many infinities. */ | /* Test batch gej -> ge conversion with many infinities. */ | ||||
for (i = 0; i < 4 * runs + 1; i++) { | for (i = 0; i < 4 * runs + 1; i++) { | ||||
random_group_element_test(&ge[i]); | random_group_element_test(&ge[i]); | ||||
/* randomly set half the points to infinitiy */ | /* randomly set half the points to infinity */ | ||||
if(secp256k1_fe_is_odd(&ge[i].x)) { | if(secp256k1_fe_is_odd(&ge[i].x)) { | ||||
secp256k1_ge_set_infinity(&ge[i]); | secp256k1_ge_set_infinity(&ge[i]); | ||||
} | } | ||||
secp256k1_gej_set_ge(&gej[i], &ge[i]); | secp256k1_gej_set_ge(&gej[i], &ge[i]); | ||||
} | } | ||||
/* batch invert */ | /* batch invert */ | ||||
secp256k1_ge_set_all_gej_var(ge, gej, 4 * runs + 1); | secp256k1_ge_set_all_gej_var(ge, gej, 4 * runs + 1); | ||||
/* check result */ | /* check result */ | ||||
▲ Show 20 Lines • Show All 3,066 Lines • Show Last 20 Lines |