diff options
author | Adam Vartanian <flooey@google.com> | 2019-02-14 14:42:19 +0000 |
---|---|---|
committer | Adam Vartanian <flooey@google.com> | 2019-02-18 10:18:52 +0000 |
commit | 27254450f01adef5f4bb25a648d42eeacc14c438 (patch) | |
tree | 90eb8fa6c24a44780cc4c4be2d50555f955d29f4 /bcprov/src/main/java/org/bouncycastle/crypto/generators/ECKeyPairGenerator.java | |
parent | bdfb209e7c1139588c82722a809c46667775a314 (diff) | |
parent | 1b335c5efbcf241b55345622fe9978047c3fdf9e (diff) | |
download | bouncycastle-27254450f01adef5f4bb25a648d42eeacc14c438.tar.gz |
Update Bouncy Castle to 1.61
Test: cts -m CtsLibcoreTestCases
Test: cts -m CtsLibcoreWycheproofBCTestCases
Change-Id: Ifcd182a8537439b945aedf80741bd51cbce37e49
Diffstat (limited to 'bcprov/src/main/java/org/bouncycastle/crypto/generators/ECKeyPairGenerator.java')
-rw-r--r-- | bcprov/src/main/java/org/bouncycastle/crypto/generators/ECKeyPairGenerator.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bcprov/src/main/java/org/bouncycastle/crypto/generators/ECKeyPairGenerator.java b/bcprov/src/main/java/org/bouncycastle/crypto/generators/ECKeyPairGenerator.java index c7660719..502f8b3e 100644 --- a/bcprov/src/main/java/org/bouncycastle/crypto/generators/ECKeyPairGenerator.java +++ b/bcprov/src/main/java/org/bouncycastle/crypto/generators/ECKeyPairGenerator.java @@ -5,6 +5,7 @@ import java.security.SecureRandom; import org.bouncycastle.crypto.AsymmetricCipherKeyPair; import org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator; +import org.bouncycastle.crypto.CryptoServicesRegistrar; import org.bouncycastle.crypto.KeyGenerationParameters; import org.bouncycastle.crypto.params.ECDomainParameters; import org.bouncycastle.crypto.params.ECKeyGenerationParameters; @@ -15,6 +16,7 @@ import org.bouncycastle.math.ec.ECMultiplier; import org.bouncycastle.math.ec.ECPoint; import org.bouncycastle.math.ec.FixedPointCombMultiplier; import org.bouncycastle.math.ec.WNafUtil; +import org.bouncycastle.util.BigIntegers; public class ECKeyPairGenerator implements AsymmetricCipherKeyPairGenerator, ECConstants @@ -32,7 +34,7 @@ public class ECKeyPairGenerator if (this.random == null) { - this.random = new SecureRandom(); + this.random = CryptoServicesRegistrar.getSecureRandom(); } } @@ -49,7 +51,7 @@ public class ECKeyPairGenerator BigInteger d; for (;;) { - d = new BigInteger(nBitLength, random); + d = BigIntegers.createRandomBigInteger(nBitLength, random); if (d.compareTo(TWO) < 0 || (d.compareTo(n) >= 0)) { |