summary refs log tree commit diff
path: root/crypto/src/security/MacUtilities.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2013-12-18 18:56:32 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2013-12-18 18:56:32 +0700
commitdb9067c0417531b339b5acf7dc923c0f26f2811f (patch)
treef189a34ee202295447e41d67b59a2dab20a2b748 /crypto/src/security/MacUtilities.cs
parentClean up all the special handling for IDEA stuff, back to a single release as... (diff)
downloadBouncyCastle.NET-ed25519-db9067c0417531b339b5acf7dc923c0f26f2811f.tar.xz
Factor out variation of MacUtilities.DoFinal
Diffstat (limited to '')
-rw-r--r--crypto/src/security/MacUtilities.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/src/security/MacUtilities.cs b/crypto/src/security/MacUtilities.cs
index 77d141411..d1f8c89b4 100644
--- a/crypto/src/security/MacUtilities.cs
+++ b/crypto/src/security/MacUtilities.cs
@@ -230,12 +230,17 @@ namespace Org.BouncyCastle.Security
             return (string) algorithms[oid.Id];
         }
 
-        public static byte[] DoFinal(
-            IMac mac)
+        public static byte[] DoFinal(IMac mac)
         {
             byte[] b = new byte[mac.GetMacSize()];
             mac.DoFinal(b, 0);
             return b;
         }
+
+        public static byte[] DoFinal(IMac mac, byte[] input)
+        {
+            mac.BlockUpdate(input, 0, input.Length);
+            return DoFinal(mac);
+        }
     }
 }