def get_prime_number(bitlength)
      prime_cand = get_random_number_with_bitlength(bitlength + 1)
      prime_cand += 1 if prime_cand.even?

      # loop, adding 2 to keep it odd, until prime_cand is prime.
      (prime_cand += 2) until miller_rabin_prime?(prime_cand)

      prime_cand
    end
def get_prime_number(bitlength)
      prime_cand = get_random_number_with_bitlength(bitlength + 1)
      prime_cand += 1 if prime_cand.even?

      # loop, adding 2 to keep it odd, until prime_cand is prime.
      (prime_cand += 2) until miller_rabin_prime?(prime_cand)

      prime_cand
    end
Finds a random prime number of *at least* bitlength
 Validate primeness using the miller-rabin primality test.
 Increment through odd numbers to test candidates until a good prime is found.