iw6-mod/deps/libtommath/mp_log_n.c

20 lines
529 B
C
Raw Normal View History

2024-02-27 01:34:37 -05:00
#include "tommath_private.h"
#ifdef MP_LOG_N_C
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
/* SPDX-License-Identifier: Unlicense */
mp_err mp_log_n(const mp_int *a, int base, int *c)
{
mp_int b;
mp_err err;
if ((err = mp_init_i32(&b, base)) != MP_OKAY) goto LTM_ERR;
if ((err = mp_log(a, &b, c)) != MP_OKAY) goto LTM_ERR;
LTM_ERR:
mp_clear(&b);
return err;
}
#endif