1 #include "tommath_private.h"
2 #ifdef S_MP_LOG_2EXPT_C
3 /* LibTomMath, multiple-precision integer library -- Tom St Denis */
4 /* SPDX-License-Identifier: Unlicense */
6 int s_mp_log_2expt(const mp_int
*a
, mp_digit base
)
9 for (y
= 0; (base
& 1) == 0; y
++, base
>>= 1) {}
10 return (mp_count_bits(a
) - 1) / y
;