summaryrefslogtreecommitdiffstats
path: root/libtommath/bn_mp_ilogb.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtommath/bn_mp_ilogb.c')
-rw-r--r--libtommath/bn_mp_ilogb.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libtommath/bn_mp_ilogb.c b/libtommath/bn_mp_ilogb.c
index 3d23d38..3185ca6 100644
--- a/libtommath/bn_mp_ilogb.c
+++ b/libtommath/bn_mp_ilogb.c
@@ -140,11 +140,7 @@ mp_err mp_ilogb(const mp_int *a, uint32_t base, mp_int *c)
while ((high - low) > 1u) {
mid = (high + low) >> 1;
- /* Difference can be larger then the type behind mp_digit can hold */
- if ((mid - low) > (unsigned int)(MP_MASK)) {
- err = MP_VAL;
- goto LBL_ERR;
- }
+
if ((err = mp_expt_u32(&bi_base, (uint32_t)(mid - low), &t)) != MP_OKAY) {
goto LBL_ERR;
}