PrimesEnhancedMRProbablePrimeTest Method
FIPS 186-4 C.3.2 Enhanced Miller-Rabin Probabilistic Primality Test.
Namespace: Org.BouncyCastle.MathAssembly: BouncyCastle.Cryptography (in BouncyCastle.Cryptography.dll) Version: 2.3.0-beta.187+d6da5648ae
Org.BouncyCastle.Math.Primes.EnhancedMRProbablePrimeTest = function(candidate, random, iterations);
- candidate BigInteger
- The BigInteger instance to test for primality.
- random SecureRandom
- The source of randomness to use to choose bases.
- iterations Int32
- The number of randomly-chosen bases to perform the test for.
PrimesMROutputAn
PrimesMROutput instance that can be further queried for details.
Run several iterations of the Miller-Rabin algorithm with randomly-chosen bases. This is an alternative to
IsMRProbablePrime(BigInteger, SecureRandom, Int32) that provides more information about a
composite candidate, which may be useful when generating or validating RSA moduli.