diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-18 13:46:39 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-18 13:46:39 +0700 |
commit | 7f4d4cefd2a86591f02073382f338cac4b84bf56 (patch) | |
tree | 73377503330c20792e179d6c51d5794034887bdc | |
parent | Improve usage/behaviour of SecureRandom.GenerateSeed (diff) | |
download | BouncyCastle.NET-ed25519-7f4d4cefd2a86591f02073382f338cac4b84bf56.tar.xz |
Access entropy source via property
-rw-r--r-- | crypto/src/crypto/prng/X931Rng.cs | 7 | ||||
-rw-r--r-- | crypto/src/crypto/prng/X931SecureRandom.cs | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/crypto/src/crypto/prng/X931Rng.cs b/crypto/src/crypto/prng/X931Rng.cs index 987379d4b..2bd8e0c6b 100644 --- a/crypto/src/crypto/prng/X931Rng.cs +++ b/crypto/src/crypto/prng/X931Rng.cs @@ -10,7 +10,7 @@ namespace Org.BouncyCastle.Crypto.Prng private const int BLOCK128_MAX_BITS_REQUEST = 1 << (19 - 1); private readonly IBlockCipher mEngine; - internal readonly IEntropySource mEntropySource; + private readonly IEntropySource mEntropySource; private readonly byte[] mDT; private readonly byte[] mI; @@ -114,6 +114,11 @@ namespace Org.BouncyCastle.Crypto.Prng mReseedCounter = 1; } + internal IEntropySource EntropySource + { + get { return mEntropySource; } + } + private void Process(byte[] res, byte[] a, byte[] b) { for (int i = 0; i != res.Length; i++) diff --git a/crypto/src/crypto/prng/X931SecureRandom.cs b/crypto/src/crypto/prng/X931SecureRandom.cs index bce8d2cf1..d2e4849c5 100644 --- a/crypto/src/crypto/prng/X931SecureRandom.cs +++ b/crypto/src/crypto/prng/X931SecureRandom.cs @@ -64,7 +64,7 @@ namespace Org.BouncyCastle.Crypto.Prng public override byte[] GenerateSeed(int numBytes) { - return EntropyUtilities.GenerateSeed(mDrbg.mEntropySource, numBytes); + return EntropyUtilities.GenerateSeed(mDrbg.EntropySource, numBytes); } } } |