From 15105e796c6cd0c23357aa54ac5a0a05af20c2a0 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Fri, 7 Oct 2022 23:27:37 +0700 Subject: More span variants in randomness classes --- crypto/test/src/security/test/SecureRandomTest.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'crypto/test/src') diff --git a/crypto/test/src/security/test/SecureRandomTest.cs b/crypto/test/src/security/test/SecureRandomTest.cs index fb18f98e0..11ebeb276 100644 --- a/crypto/test/src/security/test/SecureRandomTest.cs +++ b/crypto/test/src/security/test/SecureRandomTest.cs @@ -231,7 +231,9 @@ namespace Org.BouncyCastle.Security.Tests #if NET6_0_OR_GREATER || NETSTANDARD2_1_OR_GREATER private static double MeasureChiSquaredSpan(SecureRandom random, int rounds) { - byte[] opts = random.GenerateSeed(2); + Span opts = stackalloc byte[2]; + random.GenerateSeed(opts); + Span counts = stackalloc int[256]; Span bs = stackalloc byte[256]; @@ -295,6 +297,12 @@ namespace Org.BouncyCastle.Security.Tests { } +#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER + public void AddSeedMaterial(ReadOnlySpan inSeed) + { + } +#endif + public virtual void AddSeedMaterial(long seed) { } -- cgit 1.5.1