singleton Random()

This commit is contained in:
Kyle Spearrin 2016-07-09 13:12:46 -04:00
parent 549ac1f996
commit d61d3c201a

View file

@ -20,6 +20,7 @@ namespace Bit.App.Services
private const int KeySize = 256;
private const int Iterations = 5000;
private readonly Random _random = new Random();
private readonly PaddedBufferedBlockCipher _cipher;
private readonly ISecureStorageService _secureStorage;
private KeyParameter _keyParameter;
@ -184,9 +185,8 @@ namespace Bit.App.Services
private byte[] GenerateRandomInitializationVector()
{
var rand = new Random();
var iv = new byte[InitializationVectorSize];
rand.NextBytes(iv);
_random.NextBytes(iv);
return iv;
}
}