1 #include "tommath_private.h"
2 #ifdef BN_S_MP_PRIME_IS_DIVISIBLE_C
3 /* LibTomMath, multiple-precision integer library -- Tom St Denis */
4 /* SPDX-License-Identifier: Unlicense */
6 /* determines if an integers is divisible by one
7 * of the first PRIME_SIZE primes or not
9 * sets result to 0 if not, 1 if yes
11 mp_err s_mp_prime_is_divisible(const mp_int *a, mp_bool *result)
20 for (ix = 0; ix < PRIVATE_MP_PRIME_TAB_SIZE; ix++) {
21 /* what is a mod LBL_prime_tab[ix] */
22 if ((err = mp_mod_d(a, s_mp_prime_tab[ix], &res)) != MP_OKAY) {
26 /* is the residue zero? */