Skip to content
Tcl Source Code Artifact [1050f05ebb]
Login

Artifact [1050f05ebb]

Artifact 1050f05ebbd3a92dd31f725f573a78e4e7c9cea08c3dcd2fb2d9e4562c5e86ab:


#include "tommath_private.h"
#ifdef BN_S_MP_LOG_2EXPT_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
/* SPDX-License-Identifier: Unlicense */

int s_mp_log_2expt(const mp_int *a, mp_digit base)
{
   int y;
   for (y = 0; (base & 1) == 0; y++, base >>= 1) {}
   return (mp_count_bits(a) - 1) / y;
}
#endif