summaryrefslogtreecommitdiff
path: root/bcprov
diff options
context:
space:
mode:
authorAdam Vartanian <flooey@google.com>2018-05-11 11:51:30 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-05-11 11:51:30 -0700
commit8221e0766e1d4be44e42f468f0f9a440c7ed2307 (patch)
tree2446dc5923cb60182ada970b62b788fdc4789235 /bcprov
parentbd58b89ee2bfaca914fa77828535e273b42e35c3 (diff)
parent883aa9d8f814820d59a3eb2b7c8948d22e77d416 (diff)
downloadbouncycastle-8221e0766e1d4be44e42f468f0f9a440c7ed2307.tar.gz
[automerger] Fix probable prime confidence calculations. am: 91719e3c1b am: b2a687151e am: b56197f5fd am: 630facd786 am: 77321115ab am: 87804b8da9
am: 883aa9d8f8 Change-Id: I845c8716a1f37a5d6a74ff4779d98704313a41bd
Diffstat (limited to 'bcprov')
-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
*/