diff options
author | Android Build Merger (Role) <noreply-android-build-merger@google.com> | 2018-05-10 22:35:49 +0000 |
---|---|---|
committer | Android Build Merger (Role) <noreply-android-build-merger@google.com> | 2018-05-10 22:35:49 +0000 |
commit | 87804b8da9fa1c84d9627bb92a48da81a9186d4d (patch) | |
tree | 2413bab2ece70e5a3d1a134ef1c7c11fb66242c2 /bcprov/src/main/java/org/bouncycastle | |
parent | 92e41bf2bd80bb2fad14b31cf7f48c4eb0c12ec9 (diff) | |
parent | 77321115aba6b0f7de87658a4cfbf222d972fc29 (diff) | |
download | bouncycastle-87804b8da9fa1c84d9627bb92a48da81a9186d4d.tar.gz |
[automerger] Fix probable prime confidence calculations. am: 91719e3c1b am: b2a687151e am: b56197f5fd am: 630facd786 am: 77321115ab
Change-Id: I6c4990456568483d2718cfe7597aa3a56cbd1836
Diffstat (limited to 'bcprov/src/main/java/org/bouncycastle')
-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 */ |