summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crypto/test/src/crypto/test/ISAPTest.cs8
-rw-r--r--crypto/test/src/crypto/test/PhotonBeetleTest.cs16
-rw-r--r--crypto/test/src/crypto/test/XoodyakTest.cs8
3 files changed, 13 insertions, 19 deletions
diff --git a/crypto/test/src/crypto/test/ISAPTest.cs b/crypto/test/src/crypto/test/ISAPTest.cs
index 500026bf9..38cf7c633 100644
--- a/crypto/test/src/crypto/test/ISAPTest.cs
+++ b/crypto/test/src/crypto/test/ISAPTest.cs
@@ -458,12 +458,10 @@ namespace Org.BouncyCastle.Crypto.Tests
                 "GetOutputSize of " + isapEngine.AlgorithmName + " is incorrect for decryption");
         }
 
-        private void ImplTestExceptions(IsapDigest isapDigest, int digestsize)
+        private void ImplTestExceptions(IsapDigest isapDigest, int digestSize)
         {
-            if (isapDigest.GetDigestSize() != digestsize)
-            {
-                Assert.Fail(isapDigest.AlgorithmName + ": digest size is not correct");
-            }
+            Assert.AreEqual(digestSize, isapDigest.GetDigestSize(),
+                isapDigest.AlgorithmName + ": digest size is not correct");
 
             try
             {
diff --git a/crypto/test/src/crypto/test/PhotonBeetleTest.cs b/crypto/test/src/crypto/test/PhotonBeetleTest.cs
index cd551432c..b9a648f17 100644
--- a/crypto/test/src/crypto/test/PhotonBeetleTest.cs
+++ b/crypto/test/src/crypto/test/PhotonBeetleTest.cs
@@ -440,17 +440,15 @@ namespace Org.BouncyCastle.Crypto.Tests
             }
         }
 
-        private void ImplTestExceptions(IDigest digest, int digestsize)
+        private void ImplTestExceptions(PhotonBeetleDigest photonBeetleDigest, int digestSize)
         {
-            if (digest.GetDigestSize() != digestsize)
-            {
-                Assert.Fail(digest.AlgorithmName + ": digest size is not correct");
-            }
+            Assert.AreEqual(digestSize, photonBeetleDigest.GetDigestSize(),
+                photonBeetleDigest.AlgorithmName + ": digest size is not correct");
 
             try
             {
-                digest.BlockUpdate(new byte[1], 1, 1);
-                Assert.Fail(digest.AlgorithmName + ": input for BlockUpdate is too short");
+                photonBeetleDigest.BlockUpdate(new byte[1], 1, 1);
+                Assert.Fail(photonBeetleDigest.AlgorithmName + ": input for BlockUpdate is too short");
             }
             catch (DataLengthException)
             {
@@ -458,8 +456,8 @@ namespace Org.BouncyCastle.Crypto.Tests
             }
             try
             {
-                digest.DoFinal(new byte[digest.GetDigestSize() - 1], 2);
-                Assert.Fail(digest.AlgorithmName + ": output for DoFinal is too short");
+                photonBeetleDigest.DoFinal(new byte[digestSize - 1], 2);
+                Assert.Fail(photonBeetleDigest.AlgorithmName + ": output for DoFinal is too short");
             }
             catch (OutputLengthException)
             {
diff --git a/crypto/test/src/crypto/test/XoodyakTest.cs b/crypto/test/src/crypto/test/XoodyakTest.cs
index b73d998f4..5cbff7a41 100644
--- a/crypto/test/src/crypto/test/XoodyakTest.cs
+++ b/crypto/test/src/crypto/test/XoodyakTest.cs
@@ -431,12 +431,10 @@ namespace Org.BouncyCastle.Crypto.Tests
             }
         }
 
-        private void ImplTestExceptions(XoodyakDigest xoodyakDigest, int digestsize)
+        private void ImplTestExceptions(XoodyakDigest xoodyakDigest, int digestSize)
         {
-            if (xoodyakDigest.GetDigestSize() != digestsize)
-            {
-                Assert.Fail(xoodyakDigest.AlgorithmName + ": digest size is not correct");
-            }
+            Assert.AreEqual(digestSize, xoodyakDigest.GetDigestSize(),
+                xoodyakDigest.AlgorithmName + ": digest size is not correct");
 
             try
             {