![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
Go to the source code of this file.
Variables | |
static const secp256k1_ge | secp256k1_ge_const_g |
|
static |
Definition at line 162 of file group_impl.h.
|
static |
Definition at line 604 of file group_impl.h.
|
static |
Definition at line 125 of file group_impl.h.
|
static |
Definition at line 42 of file group_impl.h.
|
static |
Definition at line 239 of file group_impl.h.
|
static |
Definition at line 46 of file group_impl.h.
|
static |
Definition at line 81 of file group_impl.h.
|
static |
Definition at line 52 of file group_impl.h.
|
static |
Definition at line 65 of file group_impl.h.
Referenced by secp256k1_ecdsa_sig_recover(), secp256k1_schnorr_sig_verify(), test_ge(), and test_schnorr_sign_verify().
|
static |
Definition at line 26 of file group_impl.h.
Referenced by secp256k1_ecmult_odd_multiples_table(), secp256k1_ge_globalz_set_table_gej(), secp256k1_ge_set_all_gej_var(), and secp256k1_ge_set_table_gej_var().
|
static |
Definition at line 107 of file group_impl.h.
|
static |
Definition at line 179 of file group_impl.h.
|
static |
Definition at line 168 of file group_impl.h.
Referenced by secp256k1_ge_set_xo_var().
|
static |
Definition at line 36 of file group_impl.h.
|
static |
Definition at line 610 of file group_impl.h.
|
static |
Definition at line 593 of file group_impl.h.
|
static |
In: Eric Brier and Marc Joye, Weierstrass Elliptic Curves and Side-Channel Attacks. In D. Naccache and P. Paillier, Eds., Public Key Cryptography, vol. 2274 of Lecture Notes in Computer Science, pages 335-345. Springer-Verlag, 2002. we find as solution for a unified addition/doubling formula: lambda = ((x1 + x2)^2 - x1 * x2 + a) / (y1 + y2), with a = 0 for secp256k1's curve equation. x3 = lambda^2 - (x1 + x2) 2*y3 = lambda * (x1 + x2 - 2 * x3) - (y1 + y2).
Substituting x_i = Xi / Zi^2 and yi = Yi / Zi^3, for i=1,2,3, gives: U1 = X1*Z2^2, U2 = X2*Z1^2 S1 = Y1*Z2^3, S2 = Y2*Z1^3 Z = Z1*Z2 T = U1+U2 M = S1+S2 Q = T*M^2 R = T^2-U1*U2 X3 = 4*(R^2-Q) Y3 = 4*(R*(3*Q-2*R^2)-M^4) Z3 = 2*M*Z (Note that the paper uses xi = Xi / Zi and yi = Yi / Zi instead.)
This formula has the benefit of being the same for both addition of distinct points and doubling. However, it breaks down in the case that either point is infinity, or that y1 = -y2. We handle these cases in the following ways:
If lambda = R/M = 0/0 we have a problem (except in the "trivial" case that Z = z1z2 = 0, and this is special-cased later on).
In case a->infinity == 1, replace r with (b->x, b->y, 1).
Definition at line 460 of file group_impl.h.
|
static |
Definition at line 354 of file group_impl.h.
|
static |
Definition at line 301 of file group_impl.h.
|
static |
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 403 of file group_impl.h.
|
static |
Definition at line 155 of file group_impl.h.
|
static |
Definition at line 296 of file group_impl.h.
|
static |
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.
Definition at line 253 of file group_impl.h.
Referenced by secp256k1_gej_add_ge_var(), secp256k1_gej_add_var(), secp256k1_gej_add_zinv_var(), and secp256k1_gej_double_nonzero().
|
static |
Definition at line 198 of file group_impl.h.
|
static |
Definition at line 215 of file group_impl.h.
Referenced by secp256k1_gej_double_nonzero().
|
static |
y^2 = x^3 + 7 (Y/Z^3)^2 = (X/Z^2)^3 + 7 Y^2 / Z^6 = X^3 / Z^6 + 7 Y^2 = X^3 + 7*Z^6
Definition at line 219 of file group_impl.h.
Referenced by run_point_times_order(), and test_point_times_order().
|
static |
Definition at line 206 of file group_impl.h.
|
static |
Definition at line 582 of file group_impl.h.
|
static |
Definition at line 191 of file group_impl.h.
Referenced by secp256k1_gej_add_ge_var().
|
static |
Definition at line 148 of file group_impl.h.
|
static |
Generator for secp256k1, value 'g' defined in "Standards for Efficient Cryptography" (SEC2) 2.7.1.
Definition at line 19 of file group_impl.h.
Referenced by ecmult_const_chain_multiply(), ecmult_const_commutativity(), run_ec_pubkey_parse_test(), secp256k1_ecmult_context_build(), secp256k1_ecmult_gen_blind(), secp256k1_ecmult_gen_context_build(), test_ecmult_constants(), and test_point_times_order().