![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
Go to the source code of this file.
Classes | |
struct | secp256k1_ge |
struct | secp256k1_gej |
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) |
#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().
#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_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) |
#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().
#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} |
|
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().
|
static |
Convert a group element back from the storage type.
Referenced by secp256k1_ecmult_const(), secp256k1_ecmult_gen(), and secp256k1_pubkey_load().
|
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().
|
static |
Check whether a group element is the point at infinity.
Referenced by ecmult_const_mult_zero_one(), secp256k1_eckey_pubkey_serialize(), secp256k1_pubkey_save(), secp256k1_schnorr_sig_verify(), test_ge(), and test_point_times_order().
|
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().
|
static |
Referenced by secp256k1_ecmult_const(), test_ecmult_constants(), and test_ge().
|
static |
Set a batch of group elements equal to the inputs given in jacobian coordinates
Referenced by secp256k1_ecmult_gen_context_build(), and test_ge().
|
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(), run_context_tests(), secp256k1_ec_pubkey_combine(), secp256k1_ec_pubkey_create(), secp256k1_ecdh(), secp256k1_ecdsa_sig_sign(), secp256k1_eckey_pubkey_tweak_add(), secp256k1_eckey_pubkey_tweak_mul(), secp256k1_ecmult_const(), secp256k1_schnorr_generate_nonce_pair(), secp256k1_schnorr_sig_recover(), secp256k1_schnorr_sig_sign(), test_add_neg_y_diff_x(), test_ec_combine(), test_ecdsa_edge_cases(), test_ecdsa_sign_verify(), test_ecmult_gen_blind(), and test_point_times_order().
|
static |
Set a batch of group elements equal to the inputs given in jacobian coordinates (with known z-ratios). zr must contain the known z-ratios such that mul(a[i].z, zr[i+1]) == a[i+1].z. zr[0] is ignored.
Referenced by secp256k1_ecmult_odd_multiples_table_storage_var(), and test_ge().
|
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(), secp256k1_schnorr_sig_recover(), and test_group_decompress().
|
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().
|
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().
|
static |
If flag is true, set *r equal to *a; otherwise leave it. Constant-time.
Referenced by secp256k1_ecmult_const(), and secp256k1_ecmult_gen().
|
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().
|
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(), secp256k1_ec_pubkey_combine(), secp256k1_ecmult_const(), secp256k1_ecmult_gen(), secp256k1_schnorr_sig_sign(), test_add_neg_y_diff_x(), test_ecmult_constants(), and test_ge().
|
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(), secp256k1_ecmult_gen_context_build(), secp256k1_ecmult_odd_multiples_table(), test_add_neg_y_diff_x(), and test_ge().
|
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_group_add_var(), run_ecmult_chain(), secp256k1_ecmult_gen_context_build(), test_add_neg_y_diff_x(), test_ge(), and test_point_times_order().
|
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(), and test_ge().
|
static |
Clear a secp256k1_gej to prevent leaking sensitive information.
Referenced by secp256k1_ecdsa_sig_sign(), secp256k1_ecmult_gen_blind(), and secp256k1_ecmult_gen_context_clear().
|
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().
|
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(), secp256k1_ecmult(), secp256k1_ecmult_const(), secp256k1_ecmult_context_build(), secp256k1_ecmult_gen_context_build(), secp256k1_ecmult_odd_multiples_table(), and test_ge().
|
static |
Compare the X coordinate of a group element (jacobian).
Referenced by secp256k1_ecdsa_sig_verify().
|
static |
Check whether a group element is the point at infinity.
Referenced by run_ecmult_chain(), secp256k1_ec_pubkey_combine(), secp256k1_ecdsa_sig_recover(), secp256k1_ecdsa_sig_verify(), secp256k1_eckey_pubkey_tweak_add(), secp256k1_schnorr_sig_recover(), secp256k1_schnorr_sig_verify(), test_ecmult_constants(), test_ge(), and test_point_times_order().
|
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(), and secp256k1_ecmult_gen_context_build().
|
static |
Rescale a jacobian point by b which must be non-zero. Constant-time.
Referenced by secp256k1_ecmult_gen_blind(), and test_ge().
|
static |
Set a group element (jacobian) equal to another which is given in affine coordinates.
Referenced by bench_setup(), ecmult_const_chain_multiply(), 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_schnorr_sig_recover(), secp256k1_schnorr_sig_verify(), and test_ge().
|
static |
Set a group element (jacobian) equal to the point at infinity.
Referenced by secp256k1_ec_pubkey_combine(), secp256k1_ecmult(), and test_ge().