Skip to content

Commit 25ff85d

Browse files
committed
move cast inside macro
1 parent b9de7c0 commit 25ff85d

8 files changed

+9
-9
lines changed

bn_mp_montgomery_reduce.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ mp_err mp_montgomery_reduce(mp_int *x, const mp_int *n, mp_digit rho)
1717
* are fixed up in the inner loop.
1818
*/
1919
digs = (n->used * 2) + 1;
20-
if ((digs < (int)MP_WARRAY) &&
21-
(x->used <= (int)MP_WARRAY) &&
20+
if ((digs < MP_WARRAY) &&
21+
(x->used <= MP_WARRAY) &&
2222
(n->used < MP_MAXFAST)) {
2323
return s_mp_montgomery_reduce_fast(x, n, rho);
2424
}

bn_mp_mul.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ mp_err mp_mul(const mp_int *a, const mp_int *b, mp_int *c)
6666
int digs = a->used + b->used + 1;
6767

6868
#ifdef BN_S_MP_MUL_DIGS_FAST_C
69-
if ((digs < (int)MP_WARRAY) &&
69+
if ((digs < MP_WARRAY) &&
7070
(MP_MIN(a->used, b->used) <= MP_MAXFAST)) {
7171
err = s_mp_mul_digs_fast(a, b, c, digs);
7272
} else

bn_mp_sqr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mp_err mp_sqr(const mp_int *a, mp_int *b)
2323
{
2424
#ifdef BN_S_MP_SQR_FAST_C
2525
/* can we use the fast comba multiplier? */
26-
if ((((a->used * 2) + 1) < (int)MP_WARRAY) &&
26+
if ((((a->used * 2) + 1) < MP_WARRAY) &&
2727
(a->used < (MP_MAXFAST / 2))) {
2828
err = s_mp_sqr_fast(a, b);
2929
} else

bn_s_mp_exptmod_fast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ mp_err s_mp_exptmod_fast(const mp_int *G, const mp_int *X, const mp_int *P, mp_i
8585

8686
/* automatically pick the comba one if available (saves quite a few calls/ifs) */
8787
#ifdef BN_S_MP_MONTGOMERY_REDUCE_FAST_C
88-
if ((((P->used * 2) + 1) < (int)MP_WARRAY) &&
88+
if ((((P->used * 2) + 1) < MP_WARRAY) &&
8989
(P->used < MP_MAXFAST)) {
9090
redux = s_mp_montgomery_reduce_fast;
9191
} else

bn_s_mp_montgomery_reduce_fast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mp_err s_mp_montgomery_reduce_fast(mp_int *x, const mp_int *n, mp_digit rho)
1717
mp_err err;
1818
mp_word W[MP_WARRAY];
1919

20-
if (x->used > (int)MP_WARRAY) {
20+
if (x->used > MP_WARRAY) {
2121
return MP_VAL;
2222
}
2323

bn_s_mp_mul_digs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mp_err s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs)
1717
mp_digit tmpx, *tmpt, *tmpy;
1818

1919
/* can we use the fast multiplier? */
20-
if ((digs < (int)MP_WARRAY) &&
20+
if ((digs < MP_WARRAY) &&
2121
(MP_MIN(a->used, b->used) < MP_MAXFAST)) {
2222
return s_mp_mul_digs_fast(a, b, c, digs);
2323
}

bn_s_mp_mul_high_digs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mp_err s_mp_mul_high_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs)
1717

1818
/* can we use the fast multiplier? */
1919
#ifdef BN_S_MP_MUL_HIGH_DIGS_FAST_C
20-
if (((a->used + b->used + 1) < (int)MP_WARRAY)
20+
if (((a->used + b->used + 1) < MP_WARRAY)
2121
&& (MP_MIN(a->used, b->used) < MP_MAXFAST)) {
2222
return s_mp_mul_high_digs_fast(a, b, c, digs);
2323
}

tommath.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ TOOM_SQR_CUTOFF;
171171
#endif
172172

173173
/* size of comba arrays, should be at least 2 * 2**(BITS_PER_WORD - BITS_PER_DIGIT*2) */
174-
#define PRIVATE_MP_WARRAY (1uLL << (((CHAR_BIT * sizeof(private_mp_word)) - (2 * MP_DIGIT_BIT)) + 1))
174+
#define PRIVATE_MP_WARRAY (int)(1uLL << (((CHAR_BIT * sizeof(private_mp_word)) - (2 * MP_DIGIT_BIT)) + 1))
175175
#define MP_WARRAY (MP_DEPRECATED_PRAGMA("MP_WARRAY is an internal macro") PRIVATE_MP_WARRAY)
176176

177177
#if defined(__GNUC__) && __GNUC__ >= 4

0 commit comments

Comments
 (0)