summary refs log tree commit diff
path: root/crypto/test
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2015-12-28 15:32:02 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2015-12-28 15:32:02 +0700
commit0684c4783deae5cf4862e78302844058e5433bce (patch)
treed7296980260e2f15460840c5b355a1b890916b1c /crypto/test
parentOptimized Sqrt and Trace for custom binary curves (diff)
downloadBouncyCastle.NET-ed25519-0684c4783deae5cf4862e78302844058e5433bce.tar.xz
Clean up a few warnings
Diffstat (limited to 'crypto/test')
-rw-r--r--crypto/test/src/crypto/test/NaccacheSternTest.cs5
-rw-r--r--crypto/test/src/crypto/test/PaddingTest.cs6
-rw-r--r--crypto/test/src/test/ECEncodingTest.cs11
3 files changed, 8 insertions, 14 deletions
diff --git a/crypto/test/src/crypto/test/NaccacheSternTest.cs b/crypto/test/src/crypto/test/NaccacheSternTest.cs
index 4fa256f12..9168adced 100644
--- a/crypto/test/src/crypto/test/NaccacheSternTest.cs
+++ b/crypto/test/src/crypto/test/NaccacheSternTest.cs
@@ -78,9 +78,6 @@ namespace Org.BouncyCastle.Crypto.Tests
 
         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 )
 
@@ -145,7 +142,7 @@ namespace Org.BouncyCastle.Crypto.Tests
 
 			// specify key generation parameters
 			NaccacheSternKeyGenerationParameters genParam
-				= new NaccacheSternKeyGenerationParameters(new SecureRandom(), 768, 8, 30, debug);
+				= new NaccacheSternKeyGenerationParameters(new SecureRandom(), 768, 8, 30);
 
 			// Initialize Key generator and generate key pair
 			NaccacheSternKeyPairGenerator pGen = new NaccacheSternKeyPairGenerator();
diff --git a/crypto/test/src/crypto/test/PaddingTest.cs b/crypto/test/src/crypto/test/PaddingTest.cs
index 6f41d754c..ed53d9228 100644
--- a/crypto/test/src/crypto/test/PaddingTest.cs
+++ b/crypto/test/src/crypto/test/PaddingTest.cs
@@ -105,11 +105,9 @@ namespace Org.BouncyCastle.Crypto.Tests
 
 		public override void PerformTest()
 		{
-			SecureRandom    rand = new SecureRandom(new byte[20]);
+            SecureRandom rand = SecureRandom.GetInstance("SHA1PRNG");
 
-			rand.SetSeed(DateTime.Now.Ticks);
-
-			doTestPadding(new Pkcs7Padding(), rand,
+            doTestPadding(new Pkcs7Padding(), rand,
 				Hex.Decode("ffffff0505050505"),
 				Hex.Decode("0000000004040404"));
 
diff --git a/crypto/test/src/test/ECEncodingTest.cs b/crypto/test/src/test/ECEncodingTest.cs
index f1a4d5e3a..8d993c15e 100644
--- a/crypto/test/src/test/ECEncodingTest.cs
+++ b/crypto/test/src/test/ECEncodingTest.cs
@@ -109,7 +109,7 @@ namespace Org.BouncyCastle.Tests
 				if (!compress)
 				{
 					//pubKey.setPointFormat("UNCOMPRESSED");
-					pubKey = SetPublicUncompressed(pubKey, false);
+					pubKey = SetPublicUncompressed(pubKey);
 				}
 
 				byte[] x = pubKey.Q.AffineXCoord.ToBigInteger().ToByteArrayUnsigned();
@@ -154,7 +154,7 @@ namespace Org.BouncyCastle.Tests
 				// TODO Private key compression?
 				//newKey.setPointFormat("UNCOMPRESSED");
 				//newPubKey.setPointFormat("UNCOMPRESSED");
-				newPubKey = SetPublicUncompressed(newPubKey, false);
+				newPubKey = SetPublicUncompressed(newPubKey);
 			}
 
 //			string newPrivateKey = new string(Hex.encode(newKey.getEncoded()));
@@ -201,7 +201,7 @@ namespace Org.BouncyCastle.Tests
 				// TODO Private key compression?
 				//privECKey.setPointFormat("UNCOMPRESSED");
 				//pubECKey.setPointFormat("UNCOMPRESSED");
-				pubECKey = SetPublicUncompressed(pubECKey, false);
+				pubECKey = SetPublicUncompressed(pubECKey);
 			}
 
 			certGen.SetSignatureAlgorithm("ECDSAwithSHA1");
@@ -216,13 +216,12 @@ namespace Org.BouncyCastle.Tests
 		}
 
 		private ECPublicKeyParameters SetPublicUncompressed(
-			ECPublicKeyParameters	key,
-			bool					withCompression)
+			ECPublicKeyParameters	key)
 		{
 			ECPoint p = key.Q.Normalize();
 			return new ECPublicKeyParameters(
 				key.AlgorithmName,
-				p.Curve.CreatePoint(p.XCoord.ToBigInteger(), p.YCoord.ToBigInteger(), withCompression),
+				p.Curve.CreatePoint(p.XCoord.ToBigInteger(), p.YCoord.ToBigInteger()),
 				key.Parameters);
 		}