summary refs log tree commit diff
path: root/crypto/test
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-10-29 18:57:05 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-10-29 18:57:05 +0700
commit7c718c3952a341cac0f38e18ddb3e4f82cc9f8b8 (patch)
tree871ef215c63025dfea08a4cdd99120ad8a07fa45 /crypto/test
parentUse correct OID (diff)
downloadBouncyCastle.NET-ed25519-7c718c3952a341cac0f38e18ddb3e4f82cc9f8b8.tar.xz
Release preparations
Diffstat (limited to 'crypto/test')
-rw-r--r--crypto/test/BouncyCastle.Crypto.Tests.csproj14
-rw-r--r--crypto/test/src/crypto/prng/test/CtrDrbgTest.cs2
-rw-r--r--crypto/test/src/crypto/prng/test/TestEntropySourceProvider.cs2
-rw-r--r--crypto/test/src/crypto/test/AesX86Test.cs6
-rw-r--r--crypto/test/src/crypto/test/BlockCipherMonteCarloTest.cs2
-rw-r--r--crypto/test/src/crypto/test/BlockCipherVectorTest.cs2
-rw-r--r--crypto/test/src/crypto/test/DigestTest.cs4
-rw-r--r--crypto/test/src/crypto/test/Haraka256DigestTest.cs2
-rw-r--r--crypto/test/src/crypto/test/Haraka512DigestTest.cs2
-rw-r--r--crypto/test/src/crypto/test/TupleHashTest.cs4
-rw-r--r--crypto/test/src/security/test/SecureRandomTest.cs8
11 files changed, 27 insertions, 21 deletions
diff --git a/crypto/test/BouncyCastle.Crypto.Tests.csproj b/crypto/test/BouncyCastle.Crypto.Tests.csproj
index 1b752ad5c..3c9b88328 100644
--- a/crypto/test/BouncyCastle.Crypto.Tests.csproj
+++ b/crypto/test/BouncyCastle.Crypto.Tests.csproj
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>net6.0;netcoreapp2.1;net462</TargetFrameworks>
+    <TargetFrameworks>net6.0;netcoreapp3.1;net472;net462</TargetFrameworks>
     <IsPackable>false</IsPackable>
     <AssemblyOriginatorKeyFile>..\..\BouncyCastle.snk</AssemblyOriginatorKeyFile>
     <SignAssembly>true</SignAssembly>
@@ -9,11 +9,11 @@
     <NoWarn>1591</NoWarn>
   </PropertyGroup>
 
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+  <PropertyGroup Condition="'$(Configuration)'=='Debug'">
     <DefineConstants>DEBUG;TRACE</DefineConstants>
   </PropertyGroup>
 
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
+  <PropertyGroup Condition="'$(Configuration)'=='Release'">
     <DefineConstants>DEBUG;TRACE</DefineConstants>
   </PropertyGroup>
 
@@ -23,10 +23,16 @@
   </ItemGroup>
   <ItemGroup>
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
+    <PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
     <PackageReference Include="NUnit" Version="3.13.3" />
     <PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\src\BouncyCastle.Crypto.csproj" />
+    <ProjectReference Include="..\src\BouncyCastle.Crypto.csproj">
+      <SetTargetFramework Condition="'$(TargetFramework)' == 'net472'">TargetFramework=netstandard2.0</SetTargetFramework>
+    </ProjectReference>
   </ItemGroup>
 </Project>
diff --git a/crypto/test/src/crypto/prng/test/CtrDrbgTest.cs b/crypto/test/src/crypto/prng/test/CtrDrbgTest.cs
index 047405c77..23dabf7cb 100644
--- a/crypto/test/src/crypto/prng/test/CtrDrbgTest.cs
+++ b/crypto/test/src/crypto/prng/test/CtrDrbgTest.cs
@@ -507,7 +507,7 @@ namespace Org.BouncyCastle.Crypto.Prng.Test
                 return cipher.ProcessBlock(input, inOff, output, outOff);
             }
 
-            // NOTE: .NET Core 2.1 has Span<T>, but is tested against our .NET Standard 2.0 assembly.
+            // NOTE: .NET Core 3.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
             public int ProcessBlock(ReadOnlySpan<byte> input, Span<byte> output)
diff --git a/crypto/test/src/crypto/prng/test/TestEntropySourceProvider.cs b/crypto/test/src/crypto/prng/test/TestEntropySourceProvider.cs
index 9ebbb7ccd..ae80b3dbe 100644
--- a/crypto/test/src/crypto/prng/test/TestEntropySourceProvider.cs
+++ b/crypto/test/src/crypto/prng/test/TestEntropySourceProvider.cs
@@ -48,7 +48,7 @@ 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.
+            // NOTE: .NET Core 3.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)
diff --git a/crypto/test/src/crypto/test/AesX86Test.cs b/crypto/test/src/crypto/test/AesX86Test.cs
index 9610c4baa..fc5a92545 100644
--- a/crypto/test/src/crypto/test/AesX86Test.cs
+++ b/crypto/test/src/crypto/test/AesX86Test.cs
@@ -1,6 +1,6 @@
-#if NETCOREAPP3_0_OR_GREATER
-using System;
-
+// NOTE: .NET Core 3.1 is tested against our .NET Standard 2.0 assembly.
+//#if NETCOREAPP3_0_OR_GREATER
+#if NET6_0_OR_GREATER
 using NUnit.Framework;
 
 using Org.BouncyCastle.Crypto.Engines;
diff --git a/crypto/test/src/crypto/test/BlockCipherMonteCarloTest.cs b/crypto/test/src/crypto/test/BlockCipherMonteCarloTest.cs
index 1a7f04702..dea6e66b1 100644
--- a/crypto/test/src/crypto/test/BlockCipherMonteCarloTest.cs
+++ b/crypto/test/src/crypto/test/BlockCipherMonteCarloTest.cs
@@ -77,7 +77,7 @@ namespace Org.BouncyCastle.Crypto.Tests
 				Fail("failed reversal");
 			}
 
-            // NOTE: .NET Core 2.1 has Span<T>, but is tested against our .NET Standard 2.0 assembly.
+            // NOTE: .NET Core 3.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
             cipher.Init(true, param);
diff --git a/crypto/test/src/crypto/test/BlockCipherVectorTest.cs b/crypto/test/src/crypto/test/BlockCipherVectorTest.cs
index 58a138982..b1a2c3051 100644
--- a/crypto/test/src/crypto/test/BlockCipherVectorTest.cs
+++ b/crypto/test/src/crypto/test/BlockCipherVectorTest.cs
@@ -71,7 +71,7 @@ namespace Org.BouncyCastle.Crypto.Tests
 				Fail("failed reversal got " + Hex.ToHexString(outBytes));
 			}
 
-            // NOTE: .NET Core 2.1 has Span<T>, but is tested against our .NET Standard 2.0 assembly.
+            // NOTE: .NET Core 3.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
 			cipher.Init(true, param);
diff --git a/crypto/test/src/crypto/test/DigestTest.cs b/crypto/test/src/crypto/test/DigestTest.cs
index 1809c07fb..dddd19cad 100644
--- a/crypto/test/src/crypto/test/DigestTest.cs
+++ b/crypto/test/src/crypto/test/DigestTest.cs
@@ -185,7 +185,7 @@ namespace Org.BouncyCastle.Crypto.Tests
 
 		internal static void SpanConsistencyTests(SimpleTest test, IDigest digest)
         {
-			// NOTE: .NET Core 2.1 has Span<T>, but is tested against our .NET Standard 2.0 assembly.
+			// NOTE: .NET Core 3.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
 
@@ -204,7 +204,7 @@ namespace Org.BouncyCastle.Crypto.Tests
 
 		internal static void SpanConsistencyTest(SimpleTest test, IDigest digest, byte[] buf, int off, int len)
         {
-			// NOTE: .NET Core 2.1 has Span<T>, but is tested against our .NET Standard 2.0 assembly.
+			// NOTE: .NET Core 3.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
 			digest.Reset();
diff --git a/crypto/test/src/crypto/test/Haraka256DigestTest.cs b/crypto/test/src/crypto/test/Haraka256DigestTest.cs
index 18ff65ddc..08cae6d57 100644
--- a/crypto/test/src/crypto/test/Haraka256DigestTest.cs
+++ b/crypto/test/src/crypto/test/Haraka256DigestTest.cs
@@ -200,7 +200,7 @@ namespace Org.BouncyCastle.Crypto.Tests
 
         private void SpanConsistencyTests()
         {
-            // NOTE: .NET Core 2.1 has Span<T>, but is tested against our .NET Standard 2.0 assembly.
+            // NOTE: .NET Core 3.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
             // Span-based API consistency checks
diff --git a/crypto/test/src/crypto/test/Haraka512DigestTest.cs b/crypto/test/src/crypto/test/Haraka512DigestTest.cs
index 1ef178222..5f84a6328 100644
--- a/crypto/test/src/crypto/test/Haraka512DigestTest.cs
+++ b/crypto/test/src/crypto/test/Haraka512DigestTest.cs
@@ -202,7 +202,7 @@ namespace Org.BouncyCastle.Crypto.Tests
 
         private void SpanConsistencyTests()
         {
-            // NOTE: .NET Core 2.1 has Span<T>, but is tested against our .NET Standard 2.0 assembly.
+            // NOTE: .NET Core 3.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
             // Span-based API consistency checks
diff --git a/crypto/test/src/crypto/test/TupleHashTest.cs b/crypto/test/src/crypto/test/TupleHashTest.cs
index 8eaa97e5c..a492dd58c 100644
--- a/crypto/test/src/crypto/test/TupleHashTest.cs
+++ b/crypto/test/src/crypto/test/TupleHashTest.cs
@@ -118,7 +118,7 @@ namespace Org.BouncyCastle.Crypto.Tests
 
         internal void SpanConsistencyTests()
         {
-            // NOTE: .NET Core 2.1 has Span<T>, but is tested against our .NET Standard 2.0 assembly.
+            // NOTE: .NET Core 3.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
             IDigest digest1 = new TupleHash(128, new byte[0]);
@@ -139,7 +139,7 @@ namespace Org.BouncyCastle.Crypto.Tests
 
         internal void SpanConsistencyTest(IDigest digest1, IDigest digest2, byte[] buf, int off, int len)
         {
-            // NOTE: .NET Core 2.1 has Span<T>, but is tested against our .NET Standard 2.0 assembly.
+            // NOTE: .NET Core 3.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
             digest1.Reset();
diff --git a/crypto/test/src/security/test/SecureRandomTest.cs b/crypto/test/src/security/test/SecureRandomTest.cs
index 11ebeb276..caba7a37a 100644
--- a/crypto/test/src/security/test/SecureRandomTest.cs
+++ b/crypto/test/src/security/test/SecureRandomTest.cs
@@ -143,7 +143,7 @@ namespace Org.BouncyCastle.Security.Tests
                     return false;
             }
 
-            // NOTE: .NET Core 2.1 has Span<T>, but is tested against our .NET Standard 2.0 assembly.
+            // NOTE: .NET Core 3.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
             {
@@ -226,7 +226,7 @@ namespace Org.BouncyCastle.Security.Tests
             return chi2;
         }
 
-        // NOTE: .NET Core 2.1 has Span<T>, but is tested against our .NET Standard 2.0 assembly.
+        // NOTE: .NET Core 3.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
         private static double MeasureChiSquaredSpan(SecureRandom random, int rounds)
@@ -314,7 +314,7 @@ namespace Org.BouncyCastle.Security.Tests
 
             public abstract void NextBytes(byte[] bytes, int start, int len);
 
-            // NOTE: .NET Core 2.1 has Span<T>, but is tested against our .NET Standard 2.0 assembly.
+            // NOTE: .NET Core 3.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
             public abstract void NextBytes(Span<byte> bytes);
@@ -336,7 +336,7 @@ namespace Org.BouncyCastle.Security.Tests
                 Arrays.Fill(bytes, start, start + len, b);
             }
 
-            // NOTE: .NET Core 2.1 has Span<T>, but is tested against our .NET Standard 2.0 assembly.
+            // NOTE: .NET Core 3.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
             public override void NextBytes(Span<byte> bytes)