Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2014-04-16 11:32:54 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2014-04-16 11:32:54 +0400
commit240b9c03eee7fa39d20018d82edc66d244b61d6f (patch)
tree804554d3982b2a96377dfa3a772623948a1193c5 /core/src/main/java/org/bouncycastle/crypto/tls/TlsBlockCipher.java
parent1b2efc5633397c40766389d56f0267fd94579b28 (diff)
Use a separate PRNG for nonces
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls/TlsBlockCipher.java')
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/TlsBlockCipher.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/TlsBlockCipher.java b/core/src/main/java/org/bouncycastle/crypto/tls/TlsBlockCipher.java
index d02d4876..9a79226c 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/TlsBlockCipher.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/TlsBlockCipher.java
@@ -43,7 +43,7 @@ public class TlsBlockCipher
this.context = context;
this.randomData = new byte[256];
- context.getSecureRandom().nextBytes(randomData);
+ context.getNonceRandomGenerator().nextBytes(randomData);
this.useExplicitIV = TlsUtils.isTLSv11(context);
this.encryptThenMAC = context.getSecurityParameters().encryptThenMAC;
@@ -183,7 +183,7 @@ public class TlsBlockCipher
if (useExplicitIV)
{
byte[] explicitIV = new byte[blockSize];
- context.getSecureRandom().nextBytes(explicitIV);
+ context.getNonceRandomGenerator().nextBytes(explicitIV);
encryptCipher.init(true, new ParametersWithIV(null, explicitIV));