summary refs log tree commit diff
path: root/crypto/src
diff options
context:
space:
mode:
authorDavid Hook <dgh@bouncycastle.org>2017-06-27 11:09:59 +1000
committerDavid Hook <dgh@bouncycastle.org>2017-06-27 11:09:59 +1000
commita0b7d3b1174a6088049e360a45db4e0c1a04b32a (patch)
tree7e442af1c37591a8176af0b699536314fd9954f8 /crypto/src
parentInitial cut of DSTU7564 digest and HMAC. (diff)
downloadBouncyCastle.NET-ed25519-a0b7d3b1174a6088049e360a45db4e0c1a04b32a.tar.xz
paddingfix for where pad block extends over 2 block boundary.
Diffstat (limited to 'crypto/src')
-rw-r--r--crypto/src/crypto/digests/DSTU7564Digest.cs16
1 files changed, 12 insertions, 4 deletions
diff --git a/crypto/src/crypto/digests/DSTU7564Digest.cs b/crypto/src/crypto/digests/DSTU7564Digest.cs
index 9a785a5c9..12057b146 100644
--- a/crypto/src/crypto/digests/DSTU7564Digest.cs
+++ b/crypto/src/crypto/digests/DSTU7564Digest.cs
@@ -212,12 +212,20 @@ namespace Org.BouncyCastle.Crypto.Digests
           {
             padded_ = Pad(buf, 0, bufOff);
 
-            ProcessBlock(padded_, 0);
+            int paddedLen = padded_.Length;
+            int paddedOff = 0;
 
- 
-               //Console.WriteLine(stateLine.Length);
+            while (paddedLen != 0)
+            {
+                ProcessBlock(padded_, paddedOff);
+                paddedOff += blockSize;
+                paddedLen -= blockSize;
+            }
+
+
+            //Console.WriteLine(stateLine.Length);
 
-               byte[][] temp = new byte[STATE_BYTE_SIZE_1024][];
+            byte[][] temp = new byte[STATE_BYTE_SIZE_1024][];
                for (int i = 0; i < state_.Length; i++)
                {
                     temp[i] = new byte[ROWS];