Skip to content

Commit 8893f42

Browse files
Avoids a potentially shortening size_t to int cast in strauss_wnaf_
Fixes #834.
1 parent c6b6b8f commit 8893f42

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ecmult_impl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ struct secp256k1_strauss_state {
443443
struct secp256k1_strauss_point_state* ps;
444444
};
445445

446-
static void secp256k1_ecmult_strauss_wnaf(const secp256k1_ecmult_context *ctx, const struct secp256k1_strauss_state *state, secp256k1_gej *r, int num, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng) {
446+
static void secp256k1_ecmult_strauss_wnaf(const secp256k1_ecmult_context *ctx, const struct secp256k1_strauss_state *state, secp256k1_gej *r, size_t num, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng) {
447447
secp256k1_ge tmpa;
448448
secp256k1_fe Z;
449449
/* Splitted G factors. */
@@ -454,8 +454,8 @@ static void secp256k1_ecmult_strauss_wnaf(const secp256k1_ecmult_context *ctx, c
454454
int bits_ng_128 = 0;
455455
int i;
456456
int bits = 0;
457-
int np;
458-
int no = 0;
457+
size_t np;
458+
size_t no = 0;
459459

460460
for (np = 0; np < num; ++np) {
461461
if (secp256k1_scalar_is_zero(&na[np]) || secp256k1_gej_is_infinity(&a[np])) {

0 commit comments

Comments
 (0)