diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-10-07 11:37:36 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-10-07 11:37:36 (GMT) |
commit | 1e29c4f4ad0ec8903b99967d45b6ea0ea76c6111 (patch) | |
tree | 2312b71d74326ff86bcbd4acecb0f10a1c0ad63c /libtommath/bn_mp_ilogb.c | |
parent | 1cb1fee6edc063cb49beb0188c2a3db4771846fa (diff) | |
download | tcl-1e29c4f4ad0ec8903b99967d45b6ea0ea76c6111.zip tcl-1e29c4f4ad0ec8903b99967d45b6ea0ea76c6111.tar.gz tcl-1e29c4f4ad0ec8903b99967d45b6ea0ea76c6111.tar.bz2 |
Update to latest "develop" branch
Diffstat (limited to 'libtommath/bn_mp_ilogb.c')
-rw-r--r-- | libtommath/bn_mp_ilogb.c | 6 |
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; } |