Skip to content

Commit

Permalink
BJA-694 minor tweak to avoid method signature change
Browse files Browse the repository at this point in the history
  • Loading branch information
dghgit committed Apr 22, 2018
1 parent 73780ac commit 22467b6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ public AsymmetricCipherKeyPair generateKeyPair()
*/
protected BigInteger chooseRandomPrime(int bitlength, BigInteger e, BigInteger sqrdBound)
{
int iterations = getNumberOfIterations(bitlength, param.getCertainty());

for (int i = 0; i != 5 * bitlength; i++)
{
BigInteger p = new BigInteger(bitlength, 1, param.getRandom());
Expand All @@ -173,7 +171,7 @@ protected BigInteger chooseRandomPrime(int bitlength, BigInteger e, BigInteger s
continue;
}

if (!isProbablePrime(p, iterations))
if (!isProbablePrime(p))
{
continue;
}
Expand All @@ -189,8 +187,10 @@ protected BigInteger chooseRandomPrime(int bitlength, BigInteger e, BigInteger s
throw new IllegalStateException("unable to generate prime number for RSA key");
}

protected boolean isProbablePrime(BigInteger x, int iterations)
protected boolean isProbablePrime(BigInteger x)
{
int iterations = getNumberOfIterations(x.bitLength(), param.getCertainty());

/*
* Primes class for FIPS 186-4 C.3 primality checking
*/
Expand Down

0 comments on commit 22467b6

Please # to comment.