summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_mul_2d.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtommath/bn_mp_mul_2d.c')
-rw-r--r--libtommath/bn_mp_mul_2d.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libtommath/bn_mp_mul_2d.c b/libtommath/bn_mp_mul_2d.c
index 4938e57..96aef85 100644
--- a/libtommath/bn_mp_mul_2d.c
+++ b/libtommath/bn_mp_mul_2d.c
@@ -28,14 +28,14 @@ int mp_mul_2d(const mp_int *a, int b, mp_int *c)
}
}
- if (c->alloc < (int)(c->used + (b / DIGIT_BIT) + 1)) {
+ if (c->alloc < (c->used + (b / DIGIT_BIT) + 1)) {
if ((res = mp_grow(c, c->used + (b / DIGIT_BIT) + 1)) != MP_OKAY) {
return res;
}
}
/* shift by as many digits in the bit count */
- if (b >= (int)DIGIT_BIT) {
+ if (b >= DIGIT_BIT) {
if ((res = mp_lshd(c, b / DIGIT_BIT)) != MP_OKAY) {
return res;
}
@@ -43,15 +43,15 @@ int mp_mul_2d(const mp_int *a, int b, mp_int *c)
/* shift any bit count < DIGIT_BIT */
d = (mp_digit)(b % DIGIT_BIT);
- if (d != 0) {
+ if (d != 0u) {
mp_digit *tmpc, shift, mask, r, rr;
int x;
/* bitmask for carries */
- mask = (((mp_digit)1) << d) - 1;
+ mask = ((mp_digit)1 << d) - (mp_digit)1;
/* shift for msbs */
- shift = DIGIT_BIT - d;
+ shift = (mp_digit)DIGIT_BIT - d;
/* alias */
tmpc = c->dp;
@@ -71,7 +71,7 @@ int mp_mul_2d(const mp_int *a, int b, mp_int *c)
}
/* set final carry */
- if (r != 0) {
+ if (r != 0u) {
c->dp[(c->used)++] = r;
}
}