diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-10-09 00:10:07 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-10-09 00:10:07 +0700 |
commit | dc05f9d7cddfd6959678ed5a9736f0add2fe63ed (patch) | |
tree | 0d88567a1f3ee2960c4651c1743d3dbaf9beca90 /crypto/test | |
parent | Tweak allocation strategy (diff) | |
download | BouncyCastle.NET-ed25519-dc05f9d7cddfd6959678ed5a9736f0add2fe63ed.tar.xz |
Improvements to PRNG classes
Diffstat (limited to 'crypto/test')
-rw-r--r-- | crypto/test/src/crypto/prng/test/TestEntropySourceProvider.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/test/src/crypto/prng/test/TestEntropySourceProvider.cs b/crypto/test/src/crypto/prng/test/TestEntropySourceProvider.cs index 647799630..9ebbb7ccd 100644 --- a/crypto/test/src/crypto/prng/test/TestEntropySourceProvider.cs +++ b/crypto/test/src/crypto/prng/test/TestEntropySourceProvider.cs @@ -48,6 +48,18 @@ namespace Org.BouncyCastle.Crypto.Prng.Test return rv; } + // NOTE: .NET Core 2.1 has Span<T>, but is tested against our .NET Standard 2.0 assembly. +//#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER +#if NET6_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER + int IEntropySource.GetEntropy(Span<byte> output) + { + int length = bitsRequired / 8; + data.AsSpan(index, length).CopyTo(output); + index += length; + return length; + } +#endif + public int EntropySize { get { return bitsRequired; } |