PrimesEnhancedMRProbablePrimeTest Method

FIPS 186-4 C.3.2 Enhanced Miller-Rabin Probabilistic Primality Test.

Definition

Namespace: Org.BouncyCastle.Math
Assembly: BouncyCastle.Cryptography (in BouncyCastle.Cryptography.dll) Version: 2.3.0-beta.187+d6da5648ae
public static PrimesMROutput EnhancedMRProbablePrimeTest(
	BigInteger candidate,
	SecureRandom random,
	int iterations
)

Parameters

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.

Return Value

PrimesMROutput
An PrimesMROutput instance that can be further queried for details.

Remarks

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.

See Also