Skip to content

Commit 22467b6

Browse files
committed
BJA-694 minor tweak to avoid method signature change
1 parent 73780ac commit 22467b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: core/src/main/java/org/bouncycastle/crypto/generators/RSAKeyPairGenerator.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,6 @@ public AsymmetricCipherKeyPair generateKeyPair()
157157
*/
158158
protected BigInteger chooseRandomPrime(int bitlength, BigInteger e, BigInteger sqrdBound)
159159
{
160-
int iterations = getNumberOfIterations(bitlength, param.getCertainty());
161-
162160
for (int i = 0; i != 5 * bitlength; i++)
163161
{
164162
BigInteger p = new BigInteger(bitlength, 1, param.getRandom());
@@ -173,7 +171,7 @@ protected BigInteger chooseRandomPrime(int bitlength, BigInteger e, BigInteger s
173171
continue;
174172
}
175173

176-
if (!isProbablePrime(p, iterations))
174+
if (!isProbablePrime(p))
177175
{
178176
continue;
179177
}
@@ -189,8 +187,10 @@ protected BigInteger chooseRandomPrime(int bitlength, BigInteger e, BigInteger s
189187
throw new IllegalStateException("unable to generate prime number for RSA key");
190188
}
191189

192-
protected boolean isProbablePrime(BigInteger x, int iterations)
190+
protected boolean isProbablePrime(BigInteger x)
193191
{
192+
int iterations = getNumberOfIterations(x.bitLength(), param.getCertainty());
193+
194194
/*
195195
* Primes class for FIPS 186-4 C.3 primality checking
196196
*/

0 commit comments

Comments
 (0)