summary refs log tree commit diff
diff options
context:
space:
mode:
authorEdward Ned Harvey <edward.harvey@conceptblossom.com>2014-08-05 11:32:29 -0400
committerEdward Ned Harvey <edward.harvey@conceptblossom.com>2014-08-05 11:32:29 -0400
commit026e0efbf6a1aa38c868c442b6813ecfac51cfd3 (patch)
tree158185698dec594098eb533c3713dfb5f5e3fda0
parentGetInstance() returns a seeded instance. If you want an unseeded instance, yo... (diff)
downloadBouncyCastle.NET-ed25519-026e0efbf6a1aa38c868c442b6813ecfac51cfd3.tar.xz
In SecureRandom, the usage of ReversedWindowGenerator only reordered the output of sha256Generator. It added computation overhead and zero cryptographic value. Removed.
-rw-r--r--crypto/src/security/SecureRandom.cs4
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/src/security/SecureRandom.cs b/crypto/src/security/SecureRandom.cs
index ef932ee8c..c91b5ee91 100644
--- a/crypto/src/security/SecureRandom.cs
+++ b/crypto/src/security/SecureRandom.cs
@@ -22,9 +22,7 @@ namespace Org.BouncyCastle.Security
 			{
 				if (master[0] == null)
 				{
-					IRandomGenerator gen = sha256Generator;
-					gen = new ReversedWindowGenerator(gen, 32);
-					SecureRandom sr = master[0] = new SecureRandom(gen);
+					SecureRandom sr = master[0] = new SecureRandom(sha256Generator);
 
 					// Even though Ticks has at most 8 or 14 bits of entropy, there's no harm in adding it.
 					sr.SetSeed(DateTime.Now.Ticks);