FIPS 186.4 compliant usage of ltm mp_prime_is_prime()

This commit is contained in:
Steffen Jaeckel 2019-04-10 09:51:35 +02:00
parent 5ed32b73e6
commit 1bfde18513

View File

@ -412,9 +412,7 @@ static int isprime(void *a, int b, int *c)
int err;
LTC_ARGCHK(a != NULL);
LTC_ARGCHK(c != NULL);
if (b == 0) {
b = LTC_MILLER_RABIN_REPS;
} /* if */
b = mp_prime_rabin_miller_trials(mp_count_bits(a));
err = mpi_to_ltc_error(mp_prime_is_prime(a, b, c));
*c = (*c == MP_YES) ? LTC_MP_YES : LTC_MP_NO;
return err;