Skip to content

Commit

Permalink
Remove *10
Browse files Browse the repository at this point in the history
  • Loading branch information
JayArrowz committed May 16, 2019
1 parent ab0ec0a commit c5a85dc
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/Salsa20Benchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@ public class Salsa20Benchmark
[BenchmarkCategory("PRNG")]
public void GenerateRandom()
{

for (int v = 0; v < 10; v++)
byte[] rng = new byte[Program.RNG_COUNT * Program.INT_SIZE];
using (SymmetricAlgorithm salsa20 = new Salsa20())
using (ICryptoTransform encrypt = salsa20.CreateEncryptor(Guid.NewGuid().ToByteArray(),
Guid.NewGuid().ToByteArray().Take(8).ToArray()))
using (MemoryStream streamInput = new MemoryStream(rng, false))
using (CryptoStream streamEncrypted = new CryptoStream(streamInput, encrypt, CryptoStreamMode.Read))
{
byte[] rng = new byte[Program.RNG_COUNT * Program.INT_SIZE];
using (SymmetricAlgorithm salsa20 = new Salsa20())
using (ICryptoTransform encrypt = salsa20.CreateEncryptor(Guid.NewGuid().ToByteArray(),
Guid.NewGuid().ToByteArray().Take(8).ToArray()))
using (MemoryStream streamInput = new MemoryStream(rng, false))
using (CryptoStream streamEncrypted = new CryptoStream(streamInput, encrypt, CryptoStreamMode.Read))
{
streamEncrypted.ReadAsync(rng).GetAwaiter().GetResult();
}
streamEncrypted.ReadAsync(rng).GetAwaiter().GetResult();
}
}
}
Expand Down

0 comments on commit c5a85dc

Please sign in to comment.