Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Go to the source code of this file.
Classes | |
struct | secp256k1_ge |
A group element of the secp256k1 curve, in affine coordinates. More... | |
struct | secp256k1_gej |
A group element of the secp256k1 curve, in jacobian coordinates. More... | |
struct | secp256k1_ge_storage |
Macros | |
#define | SECP256K1_GE_CONST(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {SECP256K1_FE_CONST((a),(b),(c),(d),(e),(f),(g),(h)), SECP256K1_FE_CONST((i),(j),(k),(l),(m),(n),(o),(p)), 0} |
#define | SECP256K1_GE_CONST_INFINITY {SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), 1} |
#define | SECP256K1_GEJ_CONST(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {SECP256K1_FE_CONST((a),(b),(c),(d),(e),(f),(g),(h)), SECP256K1_FE_CONST((i),(j),(k),(l),(m),(n),(o),(p)), SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 1), 0} |
#define | SECP256K1_GEJ_CONST_INFINITY {SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), 1} |
#define | SECP256K1_GE_STORAGE_CONST(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {SECP256K1_FE_STORAGE_CONST((a),(b),(c),(d),(e),(f),(g),(h)), SECP256K1_FE_STORAGE_CONST((i),(j),(k),(l),(m),(n),(o),(p))} |
#define | SECP256K1_GE_STORAGE_CONST_GET(t) SECP256K1_FE_STORAGE_CONST_GET(t.x), SECP256K1_FE_STORAGE_CONST_GET(t.y) |
Functions | |
static void | secp256k1_ge_set_xy (secp256k1_ge *r, const secp256k1_fe *x, const secp256k1_fe *y) |
Set a group element equal to the point with given X and Y coordinates. More... | |
static int | secp256k1_ge_set_xquad (secp256k1_ge *r, const secp256k1_fe *x) |
Set a group element (affine) equal to the point with the given X coordinate and a Y coordinate that is a quadratic residue modulo p. More... | |
static int | secp256k1_ge_set_xo_var (secp256k1_ge *r, const secp256k1_fe *x, int odd) |
Set a group element (affine) equal to the point with the given X coordinate, and given oddness for Y. More... | |
static int | secp256k1_ge_is_infinity (const secp256k1_ge *a) |
Check whether a group element is the point at infinity. More... | |
static int | secp256k1_ge_is_valid_var (const secp256k1_ge *a) |
Check whether a group element is valid (i.e., on the curve). More... | |
static void | secp256k1_ge_neg (secp256k1_ge *r, const secp256k1_ge *a) |
static void | secp256k1_ge_set_gej (secp256k1_ge *r, secp256k1_gej *a) |
Set a group element equal to another which is given in jacobian coordinates. More... | |
static void | secp256k1_ge_set_all_gej_var (secp256k1_ge *r, const secp256k1_gej *a, size_t len) |
Set a batch of group elements equal to the inputs given in jacobian coordinates. More... | |
static void | secp256k1_ge_globalz_set_table_gej (size_t len, secp256k1_ge *r, secp256k1_fe *globalz, const secp256k1_gej *a, const secp256k1_fe *zr) |
Bring a batch inputs given in jacobian coordinates (with known z-ratios) to the same global z "denominator". More... | |
static void | secp256k1_ge_set_infinity (secp256k1_ge *r) |
Set a group element (affine) equal to the point at infinity. More... | |
static void | secp256k1_gej_set_infinity (secp256k1_gej *r) |
Set a group element (jacobian) equal to the point at infinity. More... | |
static void | secp256k1_gej_set_ge (secp256k1_gej *r, const secp256k1_ge *a) |
Set a group element (jacobian) equal to another which is given in affine coordinates. More... | |
static int | secp256k1_gej_eq_x_var (const secp256k1_fe *x, const secp256k1_gej *a) |
Compare the X coordinate of a group element (jacobian). More... | |
static void | secp256k1_gej_neg (secp256k1_gej *r, const secp256k1_gej *a) |
Set r equal to the inverse of a (i.e., mirrored around the X axis) More... | |
static int | secp256k1_gej_is_infinity (const secp256k1_gej *a) |
Check whether a group element is the point at infinity. More... | |
static int | secp256k1_gej_has_quad_y_var (const secp256k1_gej *a) |
Check whether a group element's y coordinate is a quadratic residue. More... | |
static void | secp256k1_gej_double_nonzero (secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr) |
Set r equal to the double of a. More... | |
static void | secp256k1_gej_double_var (secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr) |
Set r equal to the double of a. More... | |
static void | secp256k1_gej_add_var (secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_gej *b, secp256k1_fe *rzr) |
Set r equal to the sum of a and b. More... | |
static void | secp256k1_gej_add_ge (secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b) |
Set r equal to the sum of a and b (with b given in affine coordinates, and not infinity). More... | |
static void | secp256k1_gej_add_ge_var (secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, secp256k1_fe *rzr) |
Set r equal to the sum of a and b (with b given in affine coordinates). More... | |
static void | secp256k1_gej_add_zinv_var (secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, const secp256k1_fe *bzinv) |
Set r equal to the sum of a and b (with the inverse of b's Z coordinate passed as bzinv). More... | |
static void | secp256k1_gej_clear (secp256k1_gej *r) |
Clear a secp256k1_gej to prevent leaking sensitive information. More... | |
static void | secp256k1_ge_clear (secp256k1_ge *r) |
Clear a secp256k1_ge to prevent leaking sensitive information. More... | |
static void | secp256k1_ge_to_storage (secp256k1_ge_storage *r, const secp256k1_ge *a) |
Convert a group element to the storage type. More... | |
static void | secp256k1_ge_from_storage (secp256k1_ge *r, const secp256k1_ge_storage *a) |
Convert a group element back from the storage type. More... | |
static void | secp256k1_ge_storage_cmov (secp256k1_ge_storage *r, const secp256k1_ge_storage *a, int flag) |
If flag is true, set *r equal to *a; otherwise leave it. More... | |
static void | secp256k1_gej_rescale (secp256k1_gej *r, const secp256k1_fe *b) |
Rescale a jacobian point by b which must be non-zero. More... | |
Macro Definition Documentation
◆ SECP256K1_GE_CONST
#define SECP256K1_GE_CONST | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
g, | |||
h, | |||
i, | |||
j, | |||
k, | |||
l, | |||
m, | |||
n, | |||
o, | |||
p | |||
) | {SECP256K1_FE_CONST((a),(b),(c),(d),(e),(f),(g),(h)), SECP256K1_FE_CONST((i),(j),(k),(l),(m),(n),(o),(p)), 0} |
Definition at line 20 of file group.h.
Referenced by ecmult_const_random_mult().
◆ SECP256K1_GE_CONST_INFINITY
#define SECP256K1_GE_CONST_INFINITY {SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), 1} |
◆ SECP256K1_GE_STORAGE_CONST
#define SECP256K1_GE_STORAGE_CONST | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
g, | |||
h, | |||
i, | |||
j, | |||
k, | |||
l, | |||
m, | |||
n, | |||
o, | |||
p | |||
) | {SECP256K1_FE_STORAGE_CONST((a),(b),(c),(d),(e),(f),(g),(h)), SECP256K1_FE_STORAGE_CONST((i),(j),(k),(l),(m),(n),(o),(p))} |
◆ SECP256K1_GE_STORAGE_CONST_GET
#define SECP256K1_GE_STORAGE_CONST_GET | ( | t | ) | SECP256K1_FE_STORAGE_CONST_GET(t.x), SECP256K1_FE_STORAGE_CONST_GET(t.y) |
◆ SECP256K1_GEJ_CONST
#define SECP256K1_GEJ_CONST | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
g, | |||
h, | |||
i, | |||
j, | |||
k, | |||
l, | |||
m, | |||
n, | |||
o, | |||
p | |||
) | {SECP256K1_FE_CONST((a),(b),(c),(d),(e),(f),(g),(h)), SECP256K1_FE_CONST((i),(j),(k),(l),(m),(n),(o),(p)), SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 1), 0} |
Definition at line 31 of file group.h.
Referenced by ecmult_const_chain_multiply(), run_ecmult_chain(), and test_add_neg_y_diff_x().
◆ SECP256K1_GEJ_CONST_INFINITY
#define SECP256K1_GEJ_CONST_INFINITY {SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), 1} |
Function Documentation
◆ secp256k1_ge_clear()
|
static |
Clear a secp256k1_ge to prevent leaking sensitive information.
Referenced by secp256k1_ec_pubkey_parse(), secp256k1_ecdsa_sig_sign(), secp256k1_ecmult_gen(), and test_ge().
◆ secp256k1_ge_from_storage()
|
static |
Convert a group element back from the storage type.
Referenced by secp256k1_ecmult_const(), secp256k1_ecmult_gen(), secp256k1_ecmult_odd_multiples_table_storage_var(), and secp256k1_pubkey_load().
◆ secp256k1_ge_globalz_set_table_gej()
|
static |
Bring a batch inputs given in jacobian coordinates (with known z-ratios) to the same global z "denominator".
zr must contain the known z-ratios such that mul(a[i].z, zr[i+1]) == a[i+1].z. zr[0] is ignored. The x and y coordinates of the result are stored in r, the common z coordinate is stored in globalz.
Referenced by secp256k1_ecmult_odd_multiples_table_globalz_windowa(), and secp256k1_ecmult_strauss_wnaf().
◆ secp256k1_ge_is_infinity()
|
static |
Check whether a group element is the point at infinity.
Referenced by ecmult_const_mult_zero_one(), secp256k1_eckey_pubkey_serialize(), secp256k1_ecmult_pippenger_wnaf(), secp256k1_pubkey_save(), test_exhaustive_addition(), test_ge(), and test_point_times_order().
◆ secp256k1_ge_is_valid_var()
|
static |
Check whether a group element is valid (i.e., on the curve).
Referenced by ecmult_const_random_mult(), run_point_times_order(), secp256k1_eckey_pubkey_parse(), and test_point_times_order().
◆ secp256k1_ge_neg()
|
static |
◆ secp256k1_ge_set_all_gej_var()
|
static |
Set a batch of group elements equal to the inputs given in jacobian coordinates.
Referenced by main(), secp256k1_ecmult_gen_context_build(), and test_ge().
◆ secp256k1_ge_set_gej()
|
static |
Set a group element equal to another which is given in jacobian coordinates.
Referenced by ecmult_const_chain_multiply(), ecmult_const_commutativity(), ecmult_const_mult_zero_one(), main(), run_context_tests(), secp256k1_ec_pubkey_combine(), secp256k1_ec_pubkey_create(), secp256k1_ecdh(), secp256k1_ecdsa_sig_sign(), secp256k1_ecdsa_sig_verify(), secp256k1_eckey_pubkey_tweak_add(), secp256k1_eckey_pubkey_tweak_mul(), secp256k1_ecmult_const(), test_add_neg_y_diff_x(), test_ec_combine(), test_ecdsa_edge_cases(), test_ecdsa_sign_verify(), test_ecmult_gen_blind(), test_ecmult_multi(), and test_point_times_order().
◆ secp256k1_ge_set_infinity()
|
static |
Set a group element (affine) equal to the point at infinity.
Referenced by test_ecmult_multi(), and test_ge().
◆ secp256k1_ge_set_xo_var()
|
static |
Set a group element (affine) equal to the point with the given X coordinate, and given oddness for Y.
Return value indicates whether the result is valid.
Referenced by bench_setup(), random_group_element_test(), run_point_times_order(), secp256k1_ecdsa_sig_recover(), secp256k1_eckey_pubkey_parse(), secp256k1_ecmult_gen_context_build(), and test_group_decompress().
◆ secp256k1_ge_set_xquad()
|
static |
Set a group element (affine) equal to the point with the given X coordinate and a Y coordinate that is a quadratic residue modulo p.
The return value is true iff a coordinate with the given X coordinate exists.
Referenced by test_group_decompress().
◆ secp256k1_ge_set_xy()
|
static |
Set a group element equal to the point with given X and Y coordinates.
Referenced by secp256k1_eckey_pubkey_parse(), and secp256k1_pubkey_load().
◆ secp256k1_ge_storage_cmov()
|
static |
If flag is true, set *r equal to *a; otherwise leave it.
Constant-time.
Referenced by secp256k1_ecmult_const(), and secp256k1_ecmult_gen().
◆ secp256k1_ge_to_storage()
|
static |
Convert a group element to the storage type.
Referenced by secp256k1_ecmult_const(), secp256k1_ecmult_gen_context_build(), secp256k1_ecmult_odd_multiples_table_storage_var(), and secp256k1_pubkey_save().
◆ secp256k1_gej_add_ge()
|
static |
Set r equal to the sum of a and b (with b given in affine coordinates, and not infinity).
Referenced by bench_group_add_affine(), main(), secp256k1_ec_pubkey_combine(), secp256k1_ecmult_const(), secp256k1_ecmult_gen(), test_add_neg_y_diff_x(), test_ecmult_constants(), test_exhaustive_addition(), and test_ge().
◆ secp256k1_gej_add_ge_var()
|
static |
Set r equal to the sum of a and b (with b given in affine coordinates).
This is more efficient than secp256k1_gej_add_var. It is identical to secp256k1_gej_add_ge but without constant-time guarantee, and b is allowed to be infinity. If rzr is non-NULL, r->z = a->z * *rzr (a cannot be infinity in that case).
Referenced by bench_group_add_affine_var(), secp256k1_ecmult_gen_context_build(), secp256k1_ecmult_odd_multiples_table(), secp256k1_ecmult_odd_multiples_table_storage_var(), secp256k1_ecmult_pippenger_wnaf(), secp256k1_ecmult_strauss_wnaf(), test_add_neg_y_diff_x(), test_ecmult_multi(), test_exhaustive_addition(), and test_ge().
◆ secp256k1_gej_add_var()
|
static |
Set r equal to the sum of a and b.
If rzr is non-NULL, r->z = a->z * *rzr (a cannot be infinity in that case).
Referenced by bench_ecmult_teardown(), bench_group_add_var(), run_ecmult_chain(), secp256k1_ecmult_gen_context_build(), secp256k1_ecmult_multi_simple_var(), secp256k1_ecmult_multi_var(), secp256k1_ecmult_pippenger_wnaf(), test_add_neg_y_diff_x(), test_ecmult_multi(), test_ecmult_multi_batching(), test_exhaustive_addition(), test_ge(), and test_point_times_order().
◆ secp256k1_gej_add_zinv_var()
|
static |
Set r equal to the sum of a and b (with the inverse of b's Z coordinate passed as bzinv).
Referenced by secp256k1_ecmult_strauss_wnaf(), test_exhaustive_addition(), and test_ge().
◆ secp256k1_gej_clear()
|
static |
Clear a secp256k1_gej to prevent leaking sensitive information.
Referenced by secp256k1_ecdsa_sig_sign(), secp256k1_ecmult_gen_blind(), secp256k1_ecmult_gen_context_clear(), and secp256k1_ecmult_pippenger_batch().
◆ secp256k1_gej_double_nonzero()
|
static |
Set r equal to the double of a.
If rzr is not-NULL, r->z = a->z * *rzr (where infinity means an implicit z = 0). a may not be zero. Constant time.
Referenced by secp256k1_ecmult_const(), and test_exhaustive_addition().
◆ secp256k1_gej_double_var()
|
static |
Set r equal to the double of a.
If rzr is not-NULL, r->z = a->z * *rzr (where infinity means an implicit z = 0).
Referenced by bench_group_double_var(), main(), secp256k1_ecmult_const(), secp256k1_ecmult_context_build(), secp256k1_ecmult_gen_context_build(), secp256k1_ecmult_odd_multiples_table(), secp256k1_ecmult_odd_multiples_table_storage_var(), secp256k1_ecmult_pippenger_wnaf(), secp256k1_ecmult_strauss_wnaf(), test_exhaustive_addition(), and test_ge().
◆ secp256k1_gej_eq_x_var()
|
static |
Compare the X coordinate of a group element (jacobian).
Referenced by secp256k1_ecdsa_sig_verify().
◆ secp256k1_gej_has_quad_y_var()
|
static |
Check whether a group element's y coordinate is a quadratic residue.
Referenced by bench_group_jacobi_var(), and test_group_decompress().
◆ secp256k1_gej_is_infinity()
|
static |
Check whether a group element is the point at infinity.
Referenced by bench_ecmult_teardown(), run_ecmult_chain(), secp256k1_ec_pubkey_combine(), secp256k1_ecdsa_sig_recover(), secp256k1_ecdsa_sig_verify(), secp256k1_eckey_pubkey_tweak_add(), secp256k1_ecmult_strauss_wnaf(), test_ecmult_constants(), test_ecmult_multi(), test_ecmult_multi_batching(), test_exhaustive_addition(), test_ge(), and test_point_times_order().
◆ secp256k1_gej_neg()
|
static |
Set r equal to the inverse of a (i.e., mirrored around the X axis)
Referenced by ecmult_const_mult_zero_one(), run_ecmult_chain(), secp256k1_ecmult_gen_blind(), secp256k1_ecmult_gen_context_build(), test_ecmult_multi(), test_ecmult_multi_batching(), test_exhaustive_addition(), and test_group_decompress().
◆ secp256k1_gej_rescale()
|
static |
Rescale a jacobian point by b which must be non-zero.
Constant-time.
Referenced by main(), secp256k1_ecmult_gen_blind(), secp256k1_ecmult_strauss_wnaf(), test_ge(), and test_group_decompress().
◆ secp256k1_gej_set_ge()
|
static |
Set a group element (jacobian) equal to another which is given in affine coordinates.
Referenced by bench_setup(), ecmult_const_chain_multiply(), main(), run_point_times_order(), secp256k1_ecdsa_sig_recover(), secp256k1_ecdsa_sig_verify(), secp256k1_eckey_pubkey_tweak_add(), secp256k1_eckey_pubkey_tweak_mul(), secp256k1_ecmult_const(), secp256k1_ecmult_context_build(), secp256k1_ecmult_gen_blind(), secp256k1_ecmult_gen_context_build(), secp256k1_ecmult_multi_simple_var(), secp256k1_ecmult_strauss_batch(), test_ecmult_multi(), test_ecmult_multi_batching(), test_ge(), and test_group_decompress().
◆ secp256k1_gej_set_infinity()
|
static |
Set a group element (jacobian) equal to the point at infinity.
Referenced by main(), secp256k1_ec_pubkey_combine(), secp256k1_ecmult_multi_simple_var(), secp256k1_ecmult_multi_var(), secp256k1_ecmult_pippenger_batch(), secp256k1_ecmult_pippenger_wnaf(), secp256k1_ecmult_strauss_batch(), secp256k1_ecmult_strauss_wnaf(), test_ecmult_multi(), test_ecmult_multi_batching(), and test_ge().