remove temp gcd variable

This commit is contained in:
jacekpoz 2024-05-13 14:03:00 +02:00
parent 72176084b0
commit b7cc408f58
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -60,10 +60,8 @@ fn euclid(a: &BigUint, b: &BigUint) -> BigUint {
fn find_e(phi: &BigUint) -> BigUint {
let mut e = thread_rng().gen_biguint_range(&1u32.into(), phi);
let mut g = gcd(&e, phi);
while g != 1u32.into() {
while gcd(&e, phi) != 1u32.into() {
e = thread_rng().gen_biguint_range(&1u32.into(), phi);
g = gcd(&e, phi);
}
e