summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_mod_2d.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtommath/bn_mp_mod_2d.c')
-rw-r--r--libtommath/bn_mp_mod_2d.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libtommath/bn_mp_mod_2d.c b/libtommath/bn_mp_mod_2d.c
index 8e69757..7a74746 100644
--- a/libtommath/bn_mp_mod_2d.c
+++ b/libtommath/bn_mp_mod_2d.c
@@ -27,7 +27,7 @@ int mp_mod_2d(const mp_int *a, int b, mp_int *c)
}
/* if the modulus is larger than the value than return */
- if (b >= (int)(a->used * DIGIT_BIT)) {
+ if (b >= (a->used * DIGIT_BIT)) {
res = mp_copy(a, c);
return res;
}
@@ -43,7 +43,7 @@ int mp_mod_2d(const mp_int *a, int b, mp_int *c)
}
/* clear the digit that is not completely outside/inside the modulus */
c->dp[b / DIGIT_BIT] &=
- (mp_digit)((((mp_digit) 1) << (((mp_digit) b) % DIGIT_BIT)) - ((mp_digit) 1));
+ ((mp_digit)1 << (mp_digit)(b % DIGIT_BIT)) - (mp_digit)1;
mp_clamp(c);
return MP_OKAY;
}