summary refs log tree commit diff
path: root/crypto/test
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-07-25 15:30:30 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-07-25 15:30:30 +0700
commit0cab5b16039e30069a934d3cc96f57212d510c77 (patch)
tree6dbaa3e1809461dd324f696a6fd972b87270f17a /crypto/test
parentImprove Pack usage (diff)
downloadBouncyCastle.NET-ed25519-0cab5b16039e30069a934d3cc96f57212d510c77.tar.xz
Fix Haraka API
Diffstat (limited to 'crypto/test')
-rw-r--r--crypto/test/src/crypto/test/Haraka256DigestTest.cs14
-rw-r--r--crypto/test/src/crypto/test/Haraka512DigestTest.cs14
2 files changed, 14 insertions, 14 deletions
diff --git a/crypto/test/src/crypto/test/Haraka256DigestTest.cs b/crypto/test/src/crypto/test/Haraka256DigestTest.cs
index 5d9ec6e9b..3f7706211 100644
--- a/crypto/test/src/crypto/test/Haraka256DigestTest.cs
+++ b/crypto/test/src/crypto/test/Haraka256DigestTest.cs
@@ -28,7 +28,7 @@ namespace Org.BouncyCastle.Crypto.Tests
             byte[] expected256 = Hex.Decode("8027ccb87949774b78d0545fb72bf70c695c2a0923cbd47bba1159efbf2b2c1c");
 
             Haraka256Digest haraka = new Haraka256Digest();
-            haraka.Update(input, 0, input.Length);
+            haraka.BlockUpdate(input, 0, input.Length);
             byte[] output = new byte[haraka.GetDigestSize()];
             haraka.DoFinal(output, 0);
             Assert.IsTrue(Arrays.AreEqual(expected256, output));
@@ -41,7 +41,7 @@ namespace Org.BouncyCastle.Crypto.Tests
             {
                 Haraka256Digest haraka = new Haraka256Digest();
                 byte[] input = new byte[31];
-                haraka.Update(input, 0, input.Length);
+                haraka.BlockUpdate(input, 0, input.Length);
                 haraka.DoFinal(null, 0);
                 Assert.Fail("fail on input not 32 bytes.");
             }
@@ -57,7 +57,7 @@ namespace Org.BouncyCastle.Crypto.Tests
             {
                 Haraka256Digest haraka = new Haraka256Digest();
                 byte[] input = new byte[33];
-                haraka.Update(input, 0, input.Length);
+                haraka.BlockUpdate(input, 0, input.Length);
                 haraka.DoFinal(null, 0);
                 Assert.Fail("fail on input not 32 bytes.");
             }
@@ -77,7 +77,7 @@ namespace Org.BouncyCastle.Crypto.Tests
             {
                 Haraka256Digest harakaCipher = new Haraka256Digest();
                 byte[] input = new byte[32];
-                harakaCipher.Update(input, 0, input.Length);
+                harakaCipher.BlockUpdate(input, 0, input.Length);
                 byte[] output = new byte[31];
                 harakaCipher.DoFinal(output, 0);
                 Assert.Fail("Output too short for digest result.");
@@ -94,7 +94,7 @@ namespace Org.BouncyCastle.Crypto.Tests
             {
                 Haraka256Digest harakaCipher = new Haraka256Digest();
                 byte[] input = new byte[32];
-                harakaCipher.Update(input, 0, input.Length);
+                harakaCipher.BlockUpdate(input, 0, input.Length);
                 byte[] output = new byte[48];
                 harakaCipher.DoFinal(output, 17);
                 Assert.Fail("Output too short for digest result.");
@@ -118,7 +118,7 @@ namespace Org.BouncyCastle.Crypto.Tests
                 byte[] expected256 = Hex.Decode("000000008027ccb87949774b78d0545fb72bf70c695c2a0923cbd47bba1159efbf2b2c1c");
 
                 Haraka256Digest harakaCipher = new Haraka256Digest();
-                harakaCipher.Update(input, 0, input.Length);
+                harakaCipher.BlockUpdate(input, 0, input.Length);
                 byte[] output = new byte[harakaCipher.GetDigestSize() + 4];
                 harakaCipher.DoFinal(output, 4);
                 Assert.IsTrue(Arrays.AreEqual(expected256, output));
@@ -158,7 +158,7 @@ namespace Org.BouncyCastle.Crypto.Tests
                 byte[] result = Hex.Decode(vector[0]);
                 for (int t = 0; t < 1000; t++)
                 {
-                    haraka.Update(result, 0, result.Length);
+                    haraka.BlockUpdate(result, 0, result.Length);
                     haraka.DoFinal(result, 0);
                 }
                 Assert.IsTrue(Arrays.AreEqual(expected, result));
diff --git a/crypto/test/src/crypto/test/Haraka512DigestTest.cs b/crypto/test/src/crypto/test/Haraka512DigestTest.cs
index 43a4beff2..11aa746af 100644
--- a/crypto/test/src/crypto/test/Haraka512DigestTest.cs
+++ b/crypto/test/src/crypto/test/Haraka512DigestTest.cs
@@ -28,7 +28,7 @@ namespace Org.BouncyCastle.Crypto.Tests
             byte[] expected512 = Hex.Decode("be7f723b4e80a99813b292287f306f625a6d57331cae5f34dd9277b0945be2aa");
 
             Haraka512Digest haraka = new Haraka512Digest();
-            haraka.Update(input, 0, input.Length);
+            haraka.BlockUpdate(input, 0, input.Length);
             byte[] output = new byte[haraka.GetDigestSize()];
             haraka.DoFinal(output, 0);
             Assert.IsTrue(Arrays.AreEqual(expected512, output));
@@ -40,7 +40,7 @@ namespace Org.BouncyCastle.Crypto.Tests
             {
                 Haraka512Digest haraka = new Haraka512Digest();
                 byte[] input = new byte[63];
-                haraka.Update(input, 0, input.Length);
+                haraka.BlockUpdate(input, 0, input.Length);
                 haraka.DoFinal(null, 0);
                 Assert.Fail("fail on input not 64 bytes.");
             }
@@ -56,7 +56,7 @@ namespace Org.BouncyCastle.Crypto.Tests
             {
                 Haraka512Digest haraka = new Haraka512Digest();
                 byte[] input = new byte[65];
-                haraka.Update(input, 0, input.Length);
+                haraka.BlockUpdate(input, 0, input.Length);
                 haraka.DoFinal(null, 0);
                 Assert.Fail("fail on input not 64 bytes.");
             }
@@ -75,7 +75,7 @@ namespace Org.BouncyCastle.Crypto.Tests
             {
                 Haraka512Digest haraka = new Haraka512Digest();
                 byte[] input = new byte[64];
-                haraka.Update(input, 0, input.Length);
+                haraka.BlockUpdate(input, 0, input.Length);
                 byte[] output = new byte[31];
                 haraka.DoFinal(output, 0);
                 Assert.Fail("Output too short for digest result.");
@@ -92,7 +92,7 @@ namespace Org.BouncyCastle.Crypto.Tests
             {
                 Haraka512Digest haraka = new Haraka512Digest();
                 byte[] input = new byte[64];
-                haraka.Update(input, 0, input.Length);
+                haraka.BlockUpdate(input, 0, input.Length);
                 byte[] output = new byte[48];
                 haraka.DoFinal(output, 17);
                 Assert.Fail("Output too short for digest result.");
@@ -115,7 +115,7 @@ namespace Org.BouncyCastle.Crypto.Tests
                 byte[] expected512 = Hex.Decode("00000000be7f723b4e80a99813b292287f306f625a6d57331cae5f34dd9277b0945be2aa");
 
                 Haraka512Digest haraka = new Haraka512Digest();
-                haraka.Update(input, 0, input.Length);
+                haraka.BlockUpdate(input, 0, input.Length);
                 byte[] output = new byte[haraka.GetDigestSize() + 4];
                 haraka.DoFinal(output, 4);
                 Assert.IsTrue(Arrays.AreEqual(expected512, output));
@@ -152,7 +152,7 @@ namespace Org.BouncyCastle.Crypto.Tests
                 byte[] result = new byte[haraka.GetDigestSize()];
                 for (int t = 0; t < 1000; t++)
                 {
-                    haraka.Update(input, 0, input.Length);
+                    haraka.BlockUpdate(input, 0, input.Length);
                     haraka.DoFinal(result, 0);
 
                     if ((t & 0x01) == 1)