Commit 629b88cf9a7c5f2dcc3099ee24f30f8cc8868203

czurnieden 2019-09-06T20:22:57

removed check against MP_MASK

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/bn_mp_ilogb.c b/bn_mp_ilogb.c
index 3d23d38..3185ca6 100644
--- a/bn_mp_ilogb.c
+++ b/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;
       }