make the is_prime checks use the strict config
This commit is contained in:
parent
596adf5d32
commit
f822767a02
1 changed files with 4 additions and 1 deletions
|
@ -66,7 +66,10 @@ fn find_e(phi: &BigUint) -> BigUint {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn generate_key_pair(p: &BigUint, q: &BigUint) -> Option<KeyPair> {
|
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;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue