Skip to content

Commit 099bad9

Browse files
Comment and check a parameter for inf in secp256k1_ecmult_const.
1 parent 6c0be85 commit 099bad9

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/ecmult_const.h

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* Multiply: R = q*A (in constant-time)
1515
* Here `bits` should be set to the maximum bitlength of the _absolute value_ of `q`, plus
1616
* one because we internally sometimes add 2 to the number during the WNAF conversion.
17+
* A must not be infinity.
1718
*/
1819
static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *q, int bits);
1920

src/ecmult_const_impl.h

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, cons
168168
* that the Z coordinate was 1, use affine addition formulae, and correct
169169
* the Z coordinate of the result once at the end.
170170
*/
171+
VERIFY_CHECK(!a->infinity);
171172
secp256k1_gej_set_ge(r, a);
172173
secp256k1_ecmult_odd_multiples_table_globalz_windowa(pre_a, &Z, r);
173174
for (i = 0; i < ECMULT_TABLE_SIZE(WINDOW_A); i++) {

0 commit comments

Comments
 (0)