diff options
author | Android Build Merger (Role) <noreply-android-build-merger@google.com> | 2018-05-10 22:35:48 +0000 |
---|---|---|
committer | Android Build Merger (Role) <noreply-android-build-merger@google.com> | 2018-05-10 22:35:48 +0000 |
commit | 77321115aba6b0f7de87658a4cfbf222d972fc29 (patch) | |
tree | 1ab210c954baaf637e070d092ea8e619eadfc2ad | |
parent | c2727c35a0a865cb64e7d9b9d9aeda4de058a443 (diff) | |
parent | 630facd7864d8f98b298b65e4ed16154af74c9f3 (diff) | |
download | bouncycastle-77321115aba6b0f7de87658a4cfbf222d972fc29.tar.gz |
[automerger] Fix probable prime confidence calculations. am: 91719e3c1b am: b2a687151e am: b56197f5fd am: 630facd786
Change-Id: I21ee58faef2591f3b38a7dd9829490e35e8e6bc9
-rw-r--r-- | bcprov/src/main/java/org/bouncycastle/crypto/generators/RSAKeyPairGenerator.java | 4 |
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 */ |