summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-07-25 12:50:47 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-07-25 12:50:47 +0700
commitad8ffbb27e9c34e5f49bac6831fc34247acf2cbb (patch)
treefdd9d99cfae2ce3576225269aaec3982bc94ad65
parentDigest tweaks (diff)
downloadBouncyCastle.NET-ed25519-ad8ffbb27e9c34e5f49bac6831fc34247acf2cbb.tar.xz
Digest tweaks
-rw-r--r--crypto/src/crypto/digests/GOST3411Digest.cs2
-rw-r--r--crypto/src/crypto/digests/MD2Digest.cs2
-rw-r--r--crypto/src/crypto/digests/ParallelHash.cs2
-rw-r--r--crypto/src/crypto/digests/TigerDigest.cs2
4 files changed, 4 insertions, 4 deletions
diff --git a/crypto/src/crypto/digests/GOST3411Digest.cs b/crypto/src/crypto/digests/GOST3411Digest.cs
index 218adf68c..123751baa 100644
--- a/crypto/src/crypto/digests/GOST3411Digest.cs
+++ b/crypto/src/crypto/digests/GOST3411Digest.cs
@@ -103,7 +103,7 @@ namespace Org.BouncyCastle.Crypto.Digests
 				length--;
 			}
 
-			while (length > xBuf.Length)
+			while (length >= xBuf.Length)
 			{
 				Array.Copy(input, inOff, xBuf, 0, xBuf.Length);
 
diff --git a/crypto/src/crypto/digests/MD2Digest.cs b/crypto/src/crypto/digests/MD2Digest.cs
index 6d90f3f9d..f72d08768 100644
--- a/crypto/src/crypto/digests/MD2Digest.cs
+++ b/crypto/src/crypto/digests/MD2Digest.cs
@@ -159,7 +159,7 @@ namespace Org.BouncyCastle.Crypto.Digests
             //
             // process whole words.
             //
-            while (length > 16)
+            while (length >= 16)
             {
                 Array.Copy(input,inOff,M,0,16);
                 ProcessChecksum(M);
diff --git a/crypto/src/crypto/digests/ParallelHash.cs b/crypto/src/crypto/digests/ParallelHash.cs
index 7d9be7618..f28795f5a 100644
--- a/crypto/src/crypto/digests/ParallelHash.cs
+++ b/crypto/src/crypto/digests/ParallelHash.cs
@@ -112,7 +112,7 @@ namespace Org.BouncyCastle.Crypto.Digests
 
             if (i < len)
             {
-                while (len - i > B)
+                while (len - i >= B)
                 {
                     compress(inBuf, inOff + i, B);
                     i += B;
diff --git a/crypto/src/crypto/digests/TigerDigest.cs b/crypto/src/crypto/digests/TigerDigest.cs
index 059232de0..ce9efdbed 100644
--- a/crypto/src/crypto/digests/TigerDigest.cs
+++ b/crypto/src/crypto/digests/TigerDigest.cs
@@ -644,7 +644,7 @@ namespace Org.BouncyCastle.Crypto.Digests
             //
             // process whole words.
             //
-            while (length > 8)
+            while (length >= 8)
             {
                 ProcessWord(input, inOff);