mirror of
https://github.com/bitwarden/android.git
synced 2024-12-18 23:31:52 +03:00
singleton Random()
This commit is contained in:
parent
549ac1f996
commit
d61d3c201a
1 changed files with 2 additions and 2 deletions
|
@ -20,6 +20,7 @@ namespace Bit.App.Services
|
||||||
private const int KeySize = 256;
|
private const int KeySize = 256;
|
||||||
private const int Iterations = 5000;
|
private const int Iterations = 5000;
|
||||||
|
|
||||||
|
private readonly Random _random = new Random();
|
||||||
private readonly PaddedBufferedBlockCipher _cipher;
|
private readonly PaddedBufferedBlockCipher _cipher;
|
||||||
private readonly ISecureStorageService _secureStorage;
|
private readonly ISecureStorageService _secureStorage;
|
||||||
private KeyParameter _keyParameter;
|
private KeyParameter _keyParameter;
|
||||||
|
@ -184,9 +185,8 @@ namespace Bit.App.Services
|
||||||
|
|
||||||
private byte[] GenerateRandomInitializationVector()
|
private byte[] GenerateRandomInitializationVector()
|
||||||
{
|
{
|
||||||
var rand = new Random();
|
|
||||||
var iv = new byte[InitializationVectorSize];
|
var iv = new byte[InitializationVectorSize];
|
||||||
rand.NextBytes(iv);
|
_random.NextBytes(iv);
|
||||||
return iv;
|
return iv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue