Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/group_impl.h
Show First 20 Lines • Show All 640 Lines • ▼ Show 20 Lines | static void secp256k1_ge_from_storage(secp256k1_ge *r, const secp256k1_ge_storage *a) { | ||||
r->infinity = 0; | r->infinity = 0; | ||||
} | } | ||||
static SECP256K1_INLINE void secp256k1_ge_storage_cmov(secp256k1_ge_storage *r, const secp256k1_ge_storage *a, int flag) { | static SECP256K1_INLINE void secp256k1_ge_storage_cmov(secp256k1_ge_storage *r, const secp256k1_ge_storage *a, int flag) { | ||||
secp256k1_fe_storage_cmov(&r->x, &a->x, flag); | secp256k1_fe_storage_cmov(&r->x, &a->x, flag); | ||||
secp256k1_fe_storage_cmov(&r->y, &a->y, flag); | secp256k1_fe_storage_cmov(&r->y, &a->y, flag); | ||||
} | } | ||||
#ifdef USE_ENDOMORPHISM | |||||
static void secp256k1_ge_mul_lambda(secp256k1_ge *r, const secp256k1_ge *a) { | static void secp256k1_ge_mul_lambda(secp256k1_ge *r, const secp256k1_ge *a) { | ||||
static const secp256k1_fe beta = SECP256K1_FE_CONST( | static const secp256k1_fe beta = SECP256K1_FE_CONST( | ||||
0x7ae96a2bul, 0x657c0710ul, 0x6e64479eul, 0xac3434e9ul, | 0x7ae96a2bul, 0x657c0710ul, 0x6e64479eul, 0xac3434e9ul, | ||||
0x9cf04975ul, 0x12f58995ul, 0xc1396c28ul, 0x719501eeul | 0x9cf04975ul, 0x12f58995ul, 0xc1396c28ul, 0x719501eeul | ||||
); | ); | ||||
*r = *a; | *r = *a; | ||||
secp256k1_fe_mul(&r->x, &r->x, &beta); | secp256k1_fe_mul(&r->x, &r->x, &beta); | ||||
} | } | ||||
#endif | |||||
static int secp256k1_gej_has_quad_y_var(const secp256k1_gej *a) { | static int secp256k1_gej_has_quad_y_var(const secp256k1_gej *a) { | ||||
secp256k1_fe yz; | secp256k1_fe yz; | ||||
if (a->infinity) { | if (a->infinity) { | ||||
return 0; | return 0; | ||||
} | } | ||||
Show All 29 Lines |