summary refs log tree commit diff
path: root/crypto/test
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2015-11-14 21:24:04 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2015-11-14 21:24:04 +0700
commitd90506bde1ced221486cb3da0a749fc4999f489c (patch)
treed13624f9ff42148156bc623d9057c9d33e599835 /crypto/test
parentCheck there is no trailing data in Asn1Object.FromByteArray (diff)
downloadBouncyCastle.NET-ed25519-d90506bde1ced221486cb3da0a749fc4999f489c.tar.xz
Only initialise static data once
Diffstat (limited to 'crypto/test')
-rw-r--r--crypto/test/src/crypto/test/NaccacheSternTest.cs32
1 files changed, 16 insertions, 16 deletions
diff --git a/crypto/test/src/crypto/test/NaccacheSternTest.cs b/crypto/test/src/crypto/test/NaccacheSternTest.cs
index faa845059..4fa256f12 100644
--- a/crypto/test/src/crypto/test/NaccacheSternTest.cs
+++ b/crypto/test/src/crypto/test/NaccacheSternTest.cs
@@ -37,12 +37,6 @@ namespace Org.BouncyCastle.Crypto.Tests
 		static readonly NaccacheSternEngine cryptEng = new NaccacheSternEngine();
 		static readonly NaccacheSternEngine decryptEng = new NaccacheSternEngine();
 
-		static NaccacheSternTest()
-		{
-			cryptEng.Debug = debug;
-			decryptEng.Debug = debug;
-		}
-
 		// Values from NaccacheStern paper
 		static readonly BigInteger a = BigInteger.ValueOf(101);
 		static readonly BigInteger u1 = BigInteger.ValueOf(3);
@@ -82,6 +76,22 @@ namespace Org.BouncyCastle.Crypto.Tests
 		//
 		static readonly string edgeInput = "ff6f77206973207468652074696d6520666f7220616c6c20676f6f64206d656e";
 
+        static NaccacheSternTest()
+        {
+            cryptEng.Debug = debug;
+            decryptEng.Debug = debug;
+
+            // First the Parameters from the NaccacheStern Paper
+            // (see http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf )
+
+            smallPrimes.Add(u1);
+            smallPrimes.Add(u2);
+            smallPrimes.Add(u3);
+            smallPrimes.Add(v1);
+            smallPrimes.Add(v2);
+            smallPrimes.Add(v3);
+        }
+
 		public override string Name
 		{
 			get { return "NaccacheStern"; }
@@ -91,16 +101,6 @@ namespace Org.BouncyCastle.Crypto.Tests
 		{
 			// Test with given key from NaccacheSternPaper (totally insecure)
 
-			// First the Parameters from the NaccacheStern Paper
-			// (see http://www.gemplus.com/smart/rd/publications/pdf/NS98pkcs.pdf )
-
-			smallPrimes.Add(u1);
-			smallPrimes.Add(u2);
-			smallPrimes.Add(u3);
-			smallPrimes.Add(v1);
-			smallPrimes.Add(v2);
-			smallPrimes.Add(v3);
-
 			NaccacheSternKeyParameters pubParameters = new NaccacheSternKeyParameters(false, g, n, sigma.BitLength);
 
 			NaccacheSternPrivateKeyParameters privParameters = new NaccacheSternPrivateKeyParameters(g, n, sigma