You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The README's generatePrime(_ width: Int) function is very slow for big numbers (can take up to 10s to generate two primes for a RSA key)
func generatePrime(_ width:Int)->BigUInt{
while true {varrandom=BigUInt.randomInteger(withExactWidth: width)
random |=BigUInt(1)
if random.isPrime(){return random
}}}
Any way to generate primes quicker?
The text was updated successfully, but these errors were encountered:
The README's
generatePrime(_ width: Int)
function is very slow for big numbers (can take up to 10s to generate two primes for a RSA key)Any way to generate primes quicker?
The text was updated successfully, but these errors were encountered: