pub fn gen_big_prime(size: &u32, threshold: u32) -> BigUint {
    let mut proposal =  gen_big_num(size);
    // Remove all even numbers to reduce the iterations a half.
    if proposal.is_even() {
        proposal = proposal + BigUint::one();
    }
    while !is_prime(&proposal, threshold) {
        // Steps of 2 to avoid the even numbers on the iterations.
        proposal =  proposal + 2.to_biguint().unwrap();
    }
    proposal
}
// Given lenght, generates a prime number of that lenght approximately.
// That prime number is prime with probability = 4^-threshold 
Given lenght, generates a prime number of that lenght approximately.
That prime number is prime with probability = 4^-threshold
Given lenght generates a prime number of that lenght approximately . That prime number is prime with probability = 4^ - threshold
pub fn gen_big_prime(size: &u32, threshold: u32) -> BigUint {
    let mut proposal =  gen_big_num(size);
    // Remove all even numbers to reduce the iterations a half.
    if proposal.is_even() {
        proposal = proposal + BigUint::one();
    }
    while !is_prime(&proposal, threshold) {
        // Steps of 2 to avoid the even numbers on the iterations.
        proposal =  proposal + 2.to_biguint().unwrap();
    }
    proposal
}
pub fn gen_big_prime ( size : & u32 , threshold : u32 ) -> BigUint { let mut proposal = gen_big_num ( size ) ; // Remove all even numbers to reduce the iterations a half. if proposal . is_even ( ) { proposal = proposal + BigUint :: one ( ) ; } while ! is_prime ( & proposal , threshold ) { // Steps of 2 to avoid the even numbers on the iterations. proposal = proposal + 2 . to_biguint ( ) . unwrap ( ) ; } proposal }
Given lenght, generates a prime number of that lenght approximately.
Given lenght generates a prime number of that lenght approximately .
size
&u32
threshold
u32