summary refs log tree commit diff
path: root/crypto/src
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src')
-rw-r--r--crypto/src/crypto/prng/SP800SecureRandom.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/crypto/src/crypto/prng/SP800SecureRandom.cs b/crypto/src/crypto/prng/SP800SecureRandom.cs

index ac69e27e2..30c838c1b 100644 --- a/crypto/src/crypto/prng/SP800SecureRandom.cs +++ b/crypto/src/crypto/prng/SP800SecureRandom.cs
@@ -81,7 +81,15 @@ namespace Org.BouncyCastle.Crypto.Prng /// <param name="additionalInput">optional additional input</param> public virtual void Reseed(byte[] additionalInput) { - mDrbg.Reseed(additionalInput); + lock (this) + { + if (mDrbg == null) + { + mDrbg = mDrbgProvider.Get(mEntropySource); + } + + mDrbg.Reseed(additionalInput); + } } } }