diff --git a/l4/z1/rsa-rs/src/main.rs b/l4/z1/rsa-rs/src/main.rs index 6094071..7fda804 100644 --- a/l4/z1/rsa-rs/src/main.rs +++ b/l4/z1/rsa-rs/src/main.rs @@ -152,19 +152,18 @@ fn main() { .expect("key length must be usize"); let p1: BigUint = thread_rng().gen_prime_exact(n, Some(PrimalityTestConfig::strict())); - let p2: BigUint = thread_rng().gen_prime_exact(n, Some(PrimalityTestConfig::strict())); - println!("p1 ({b} bits): {p1}", b = p1.bits()); + + let p2: BigUint = thread_rng().gen_prime_exact(n, Some(PrimalityTestConfig::strict())); println!("p2 ({b} bits): {p2}", b = p1.bits()); let pair_a = generate_key_pair(&p1, &p2) .expect("failed to generate key pair a"); + println!("private key A: {}", pair_a.private); + println!("public key A: {}", pair_a.public); let pair_b = generate_key_pair(&p1, &p2) .expect("failed to generate key pair b"); - - println!("private key A: {}", pair_a.private); - println!("public key A: {}", pair_a.public); println!("private key B: {}", pair_b.private); println!("public key B: {}", pair_b.public);