|
static void | secp256k1_ge_verify (const secp256k1_ge *a) |
|
static void | secp256k1_gej_verify (const secp256k1_gej *a) |
|
static void | secp256k1_ge_set_gej_zinv (secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_fe *zi) |
|
static void | secp256k1_ge_set_ge_zinv (secp256k1_ge *r, const secp256k1_ge *a, const secp256k1_fe *zi) |
|
static void | secp256k1_ge_set_xy (secp256k1_ge *r, const secp256k1_fe *x, const secp256k1_fe *y) |
|
static int | secp256k1_ge_is_infinity (const secp256k1_ge *a) |
|
static void | secp256k1_ge_neg (secp256k1_ge *r, const secp256k1_ge *a) |
|
static void | secp256k1_ge_set_gej (secp256k1_ge *r, secp256k1_gej *a) |
|
static void | secp256k1_ge_set_gej_var (secp256k1_ge *r, secp256k1_gej *a) |
|
static void | secp256k1_ge_set_all_gej_var (secp256k1_ge *r, const secp256k1_gej *a, size_t len) |
|
static void | secp256k1_ge_table_set_globalz (size_t len, secp256k1_ge *a, const secp256k1_fe *zr) |
|
static void | secp256k1_gej_set_infinity (secp256k1_gej *r) |
|
static void | secp256k1_ge_set_infinity (secp256k1_ge *r) |
|
static void | secp256k1_gej_clear (secp256k1_gej *r) |
|
static void | secp256k1_ge_clear (secp256k1_ge *r) |
|
static int | secp256k1_ge_set_xo_var (secp256k1_ge *r, const secp256k1_fe *x, int odd) |
|
static void | secp256k1_gej_set_ge (secp256k1_gej *r, const secp256k1_ge *a) |
|
static int | secp256k1_gej_eq_var (const secp256k1_gej *a, const secp256k1_gej *b) |
|
static int | secp256k1_gej_eq_ge_var (const secp256k1_gej *a, const secp256k1_ge *b) |
|
static int | secp256k1_ge_eq_var (const secp256k1_ge *a, const secp256k1_ge *b) |
|
static int | secp256k1_gej_eq_x_var (const secp256k1_fe *x, const secp256k1_gej *a) |
|
static void | secp256k1_gej_neg (secp256k1_gej *r, const secp256k1_gej *a) |
|
static int | secp256k1_gej_is_infinity (const secp256k1_gej *a) |
|
static int | secp256k1_ge_is_valid_var (const secp256k1_ge *a) |
|
static SECP256K1_INLINE void | secp256k1_gej_double (secp256k1_gej *r, const secp256k1_gej *a) |
|
static void | secp256k1_gej_double_var (secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr) |
|
static void | secp256k1_gej_add_var (secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_gej *b, secp256k1_fe *rzr) |
|
static void | secp256k1_gej_add_ge_var (secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, secp256k1_fe *rzr) |
|
static void | secp256k1_gej_add_zinv_var (secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, const secp256k1_fe *bzinv) |
|
static void | secp256k1_gej_add_ge (secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b) |
|
static void | secp256k1_gej_rescale (secp256k1_gej *r, const secp256k1_fe *s) |
|
static void | secp256k1_ge_to_storage (secp256k1_ge_storage *r, const secp256k1_ge *a) |
|
static void | secp256k1_ge_from_storage (secp256k1_ge *r, const secp256k1_ge_storage *a) |
|
static SECP256K1_INLINE void | secp256k1_gej_cmov (secp256k1_gej *r, const secp256k1_gej *a, int flag) |
|
static SECP256K1_INLINE void | secp256k1_ge_storage_cmov (secp256k1_ge_storage *r, const secp256k1_ge_storage *a, int flag) |
|
static void | secp256k1_ge_mul_lambda (secp256k1_ge *r, const secp256k1_ge *a) |
|
static int | secp256k1_ge_is_in_correct_subgroup (const secp256k1_ge *ge) |
|
static int | secp256k1_ge_x_on_curve_var (const secp256k1_fe *x) |
|
static int | secp256k1_ge_x_frac_on_curve_var (const secp256k1_fe *xn, const secp256k1_fe *xd) |
|
static void | secp256k1_ge_to_bytes (unsigned char *buf, const secp256k1_ge *a) |
|
static void | secp256k1_ge_from_bytes (secp256k1_ge *r, const unsigned char *buf) |
|
static void | secp256k1_ge_to_bytes_ext (unsigned char *data, const secp256k1_ge *ge) |
|
static void | secp256k1_ge_from_bytes_ext (secp256k1_ge *ge, const unsigned char *data) |
|
We need to calculate (rx,ry,rz) = (ax,ay,az) + (bx,by,1/bzinv). Due to secp256k1's isomorphism we can multiply the Z coordinates on both sides by bzinv, and get: (rx,ry,rz*bzinv) = (ax,ay,az*bzinv) + (bx,by,1). This means that (rx,ry,rz) can be calculated as (ax,ay,az*bzinv) + (bx,by,1), when not applying the bzinv factor to rz. The variable az below holds the modified Z coordinate for a, which is used for the computation of rx and ry, but not for rz.
Definition at line 615 of file group_impl.h.
For secp256k1, 2Q is infinity if and only if Q is infinity. This is because if 2Q = infinity, Q must equal -Q, or that Q.y == -(Q.y), or Q.y is 0. For a point on y^2 = x^3 + 7 to have y=0, x^3 must be -7 mod p. However, -7 has no cube root mod p.
Having said this, if this function receives a point on a sextic twist, e.g. by a fault attack, it is possible for y to be 0. This happens for y^2 = x^3 + 6, since -6 does have a cube root mod p. For this point, this function will not set the infinity flag even though the point doubles to infinity, and the result point will be gibberish (z = 0 but infinity = 0).
Definition at line 457 of file group_impl.h.