Refine random generator handling
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
This commit is contained in:
@@ -237,10 +237,10 @@ namespace Shadowsocks.Encryption
|
||||
|
||||
protected static void randBytes(byte[] buf, int length)
|
||||
{
|
||||
byte[] temp = new byte[length];
|
||||
RNGCryptoServiceProvider rngServiceProvider = new RNGCryptoServiceProvider();
|
||||
rngServiceProvider.GetBytes(temp);
|
||||
temp.CopyTo(buf, 0);
|
||||
using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())
|
||||
{
|
||||
rng.GetBytes(buf, 0, length);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Encrypt(byte[] buf, int length, byte[] outbuf, out int outlength)
|
||||
|
||||
Reference in New Issue
Block a user