Skip to content

Commit

Permalink
Comment and check a parameter for inf in secp256k1_ecmult_const.
Browse files Browse the repository at this point in the history
  • Loading branch information
roconnor-blockstream committed Dec 3, 2021
1 parent 6c0be85 commit 099bad9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ecmult_const.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Multiply: R = q*A (in constant-time)
* Here `bits` should be set to the maximum bitlength of the _absolute value_ of `q`, plus
* one because we internally sometimes add 2 to the number during the WNAF conversion.
* A must not be infinity.
*/
static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *q, int bits);

Expand Down
1 change: 1 addition & 0 deletions src/ecmult_const_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, cons
* that the Z coordinate was 1, use affine addition formulae, and correct
* the Z coordinate of the result once at the end.
*/
VERIFY_CHECK(!a->infinity);
secp256k1_gej_set_ge(r, a);
secp256k1_ecmult_odd_multiples_table_globalz_windowa(pre_a, &Z, r);
for (i = 0; i < ECMULT_TABLE_SIZE(WINDOW_A); i++) {
Expand Down

0 comments on commit 099bad9

Please sign in to comment.