PrimesIsMRProbablePrime Method
FIPS 186-4 C.3.1 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.IsMRProbablePrime = 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.
Booleanfalse if any witness to compositeness is found amongst the chosen bases (so
candidate is definitely NOT prime), or else
true (indicating primality with some
probability dependent on the number of iterations that were performed).
Run several iterations of the Miller-Rabin algorithm with randomly-chosen bases.