diff options
Diffstat (limited to 'libtommath/bn_s_mp_mul_digs.c')
-rw-r--r-- | libtommath/bn_s_mp_mul_digs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libtommath/bn_s_mp_mul_digs.c b/libtommath/bn_s_mp_mul_digs.c index af13a02..214ae31 100644 --- a/libtommath/bn_s_mp_mul_digs.c +++ b/libtommath/bn_s_mp_mul_digs.c @@ -28,9 +28,9 @@ int s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) mp_digit tmpx, *tmpt, *tmpy; /* can we use the fast multiplier? */ - if (((digs) < MP_WARRAY) && + if ((digs < (int)MP_WARRAY) && (MIN(a->used, b->used) < - (1 << ((CHAR_BIT * sizeof(mp_word)) - (2 * DIGIT_BIT))))) { + (int)(1u << (((size_t)CHAR_BIT * sizeof(mp_word)) - (2u * (size_t)DIGIT_BIT))))) { return fast_s_mp_mul_digs(a, b, c, digs); } @@ -66,10 +66,10 @@ int s_mp_mul_digs(const mp_int *a, const mp_int *b, mp_int *c, int digs) (mp_word)u; /* the new column is the lower part of the result */ - *tmpt++ = (mp_digit)(r & ((mp_word) MP_MASK)); + *tmpt++ = (mp_digit)(r & (mp_word)MP_MASK); /* get the carry word from the result */ - u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); + u = (mp_digit)(r >> (mp_word)DIGIT_BIT); } /* set carry if it is placed below digs */ if ((ix + iy) < digs) { |