summary refs log tree commit diff
path: root/crypto/test/src
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2022-08-24 21:28:07 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2022-08-24 21:28:07 +0700
commit02bb35f614bf0f76ea5cc3728a23aa2bf898bd05 (patch)
tree308cc2100382d8335fd7b02acebddb7a557e0b67 /crypto/test/src
parentTlsCrypto only needs IAeadCipher (diff)
downloadBouncyCastle.NET-ed25519-02bb35f614bf0f76ea5cc3728a23aa2bf898bd05.tar.xz
Fix GcmSivBlockCipher processing
Diffstat (limited to 'crypto/test/src')
-rw-r--r--crypto/test/src/crypto/test/GcmSivTest.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/test/src/crypto/test/GcmSivTest.cs b/crypto/test/src/crypto/test/GcmSivTest.cs
index 16e53abdf..47f824db6 100644
--- a/crypto/test/src/crypto/test/GcmSivTest.cs
+++ b/crypto/test/src/crypto/test/GcmSivTest.cs
@@ -74,6 +74,15 @@ namespace Org.BouncyCastle.Crypto.Tests
                 pCipher.DoFinal(myOutput, 0);
                 IsTrue("Encryption mismatch", Arrays.AreEqual(myExpected, myOutput));
 
+                if (myData.Length >= 2)
+                {
+                    /* Repeat processing checking processBytes with non-empty internal buffer */
+                    pCipher.ProcessByte(myData[0], null, 0);
+                    pCipher.ProcessBytes(myData, 1, myData.Length - 1, null, 0);
+                    pCipher.DoFinal(myOutput, 0);
+                    IsTrue("Encryption mismatch", Arrays.AreEqual(myExpected, myOutput));
+                }
+
                 /* Re-initialise the cipher */
                 pCipher.Init(false, myParams);
                 pCipher.ProcessBytes(myOutput, 0, myOutput.Length, null, 0);