Пример #1
0
static int isprime(void *a, int *b)
{
	LTC_ARGCHK(a != NULL);
	LTC_ARGCHK(b != NULL);
	*b = mpa_is_prob_prime((mpanum) a, 100, external_mem_pool) != 0 ? LTC_MP_YES : LTC_MP_NO;
	return CRYPT_OK;
}
Пример #2
0
/*
 *  TEE_BigIntIsProbablePrime
 */
int32_t TEE_BigIntIsProbablePrime(const TEE_BigInt *op,
				  uint32_t confidenceLevel)
{
	mpanum mpa_op = (mpa_num_base *)op;

	if (confidenceLevel < 80)
		confidenceLevel = 80;

	if (confidenceLevel > 256)
		confidenceLevel = 256;

	return mpa_is_prob_prime(mpa_op, confidenceLevel, mempool);
}