summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2018-08-07 16:51:26 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-08-07 16:51:26 +0000
commit8ac7044ca44505764fdc9fa4e96fe79c11a2736a (patch)
tree29d4b911d329cd1763a18f1df285d349d3bc06c3
parent92e371bf810507957295981437c1fda6c3208fef (diff)
parente2e71a038670b4fa3698429f7d0f98d2a83b8054 (diff)
downloadbouncycastle-android-o-mr1-iot-release-1.0.3.tar.gz
-rw-r--r--bcprov/src/main/java/org/bouncycastle/crypto/generators/RSAKeyPairGenerator.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/bcprov/src/main/java/org/bouncycastle/crypto/generators/RSAKeyPairGenerator.java b/bcprov/src/main/java/org/bouncycastle/crypto/generators/RSAKeyPairGenerator.java
index f23f654b..beb1aee2 100644
--- a/bcprov/src/main/java/org/bouncycastle/crypto/generators/RSAKeyPairGenerator.java
+++ b/bcprov/src/main/java/org/bouncycastle/crypto/generators/RSAKeyPairGenerator.java
@@ -20,12 +20,10 @@ public class RSAKeyPairGenerator
private static final BigInteger ONE = BigInteger.valueOf(1);
private RSAKeyGenerationParameters param;
- private int iterations;
public void init(KeyGenerationParameters param)
{
this.param = (RSAKeyGenerationParameters)param;
- this.iterations = getNumberOfIterations(this.param.getStrength(), this.param.getCertainty());
}
public AsymmetricCipherKeyPair generateKeyPair()
@@ -191,6 +189,8 @@ public class RSAKeyPairGenerator
protected boolean isProbablePrime(BigInteger x)
{
+ int iterations = getNumberOfIterations(x.bitLength(), param.getCertainty());
+
/*
* Primes class for FIPS 186-4 C.3 primality checking
*/