diff options
author | Adam Vartanian <flooey@google.com> | 2018-05-11 11:45:29 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-05-11 11:45:29 -0700 |
commit | 883aa9d8f814820d59a3eb2b7c8948d22e77d416 (patch) | |
tree | dd8eae8f997ae695b20ab3c2a0a00b3daa46460d | |
parent | 20533b40830afd8927104d3879bf804683ee32db (diff) | |
parent | 87804b8da9fa1c84d9627bb92a48da81a9186d4d (diff) | |
download | bouncycastle-883aa9d8f814820d59a3eb2b7c8948d22e77d416.tar.gz |
[automerger] Fix probable prime confidence calculations. am: 91719e3c1b am: b2a687151e am: b56197f5fd am: 630facd786 am: 77321115ab
am: 87804b8da9
Change-Id: I71dcde16b772afb4d12aaca388b636193c6c58cf
-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 */ |