summaryrefslogtreecommitdiff
path: root/bcprov/src/main/java/org/bouncycastle
diff options
context:
space:
mode:
authorAdam Vartanian <flooey@google.com>2018-05-11 12:26:27 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-05-11 12:26:27 -0700
commit0908ee0eee4086380718e32950ec09d95ec38235 (patch)
treee2894b057a01956b21e7fa1dfdf2e8826ec61b82 /bcprov/src/main/java/org/bouncycastle
parent75d1f2809f6c1bcd3b11d251ff01172e2ab67b5f (diff)
parent1dd6ff9211e597935e334d610b6831473f11db5d (diff)
downloadbouncycastle-0908ee0eee4086380718e32950ec09d95ec38235.tar.gz
[automerger] Fix probable prime confidence calculations. am: 91719e3c1b am: b2a687151e am: b56197f5fd am: 630facd786 am: 77321115ab am: 87804b8da9 am: 883aa9d8f8 am: 8221e0766e
am: 1dd6ff9211 Change-Id: Icdcda163ef35afc1c9e2bdcc39f082b1b82b3522
Diffstat (limited to 'bcprov/src/main/java/org/bouncycastle')
-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
*/