Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/tests_exhaustive.c
Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | for (i = 0; i < order; i++) { | ||||
ecmult_multi_data data; | ecmult_multi_data data; | ||||
secp256k1_scalar_set_int(&data.sc[0], i); | secp256k1_scalar_set_int(&data.sc[0], i); | ||||
secp256k1_scalar_set_int(&data.sc[1], j); | secp256k1_scalar_set_int(&data.sc[1], j); | ||||
secp256k1_scalar_set_int(&g_sc, k); | secp256k1_scalar_set_int(&g_sc, k); | ||||
data.pt[0] = group[x]; | data.pt[0] = group[x]; | ||||
data.pt[1] = group[y]; | data.pt[1] = group[y]; | ||||
secp256k1_ecmult_multi_var(&ctx->ecmult_ctx, scratch, &tmp, &g_sc, ecmult_multi_callback, &data, 2); | secp256k1_ecmult_multi_var(&ctx->error_callback, &ctx->ecmult_ctx, scratch, &tmp, &g_sc, ecmult_multi_callback, &data, 2); | ||||
ge_equals_gej(&group[(i * x + j * y + k) % order], &tmp); | ge_equals_gej(&group[(i * x + j * y + k) % order], &tmp); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
secp256k1_scratch_destroy(scratch); | secp256k1_scratch_destroy(&ctx->error_callback, scratch); | ||||
} | } | ||||
void r_from_k(secp256k1_scalar *r, const secp256k1_ge *group, int k) { | void r_from_k(secp256k1_scalar *r, const secp256k1_ge *group, int k) { | ||||
secp256k1_fe x; | secp256k1_fe x; | ||||
unsigned char x_bin[32]; | unsigned char x_bin[32]; | ||||
k %= EXHAUSTIVE_TEST_ORDER; | k %= EXHAUSTIVE_TEST_ORDER; | ||||
x = group[k].x; | x = group[k].x; | ||||
secp256k1_fe_normalize(&x); | secp256k1_fe_normalize(&x); | ||||
▲ Show 20 Lines • Show All 281 Lines • Show Last 20 Lines |