make the is_prime checks use the strict config

This commit is contained in:
jacekpoz 2024-05-14 15:37:02 +02:00
parent 596adf5d32
commit f822767a02
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -66,7 +66,10 @@ fn find_e(phi: &BigUint) -> BigUint {
}
fn generate_key_pair(p: &BigUint, q: &BigUint) -> Option<KeyPair> {
if !is_prime(p, None).probably() || !is_prime(q, None).probably() || p == q {
if !is_prime(p, Some(PrimalityTestConfig::strict())).probably()
|| !is_prime(q, Some(PrimalityTestConfig::strict())).probably()
|| p == q
{
return None;
}