probablePrime

fun probablePrime(bitLength: Int, rnd: Random): BigInteger

Returns a positive BigInteger that is probably prime, with the specified bitLength. The probability that a BigInteger returned by this method is composite does not exceed 2<sup>-100</sup>.

Return

a BigInteger of bitLength bits that is probably prime

Since

1.4

See also

org.gciatto.kt.math.BigInteger.Companion

Parameters

bitLength

bitLength of the returned BigInteger.

rnd

source of random bits used to select candidates to be tested for primality.

Throws

bitLength < 2 or bitLength is too large.