summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Hook <dgh@cryptoworkshop.com>2015-11-16 10:08:38 +1100
committerDavid Hook <dgh@cryptoworkshop.com>2015-11-16 10:08:38 +1100
commit20e56efe5b9d6b1f27007c92166114f50c9ee163 (patch)
tree7ac14bd154d12a7a2693691c37066a14b1dcbbc9
parentCheck in our strong name key (diff)
downloadBouncyCastle.NET-ed25519-20e56efe5b9d6b1f27007c92166114f50c9ee163.tar.xz
added 3[] Concatenate
-rw-r--r--crypto/src/util/Arrays.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/crypto/src/util/Arrays.cs b/crypto/src/util/Arrays.cs
index 1f9711555..6be94c543 100644
--- a/crypto/src/util/Arrays.cs
+++ b/crypto/src/util/Arrays.cs
@@ -591,6 +591,28 @@ namespace Org.BouncyCastle.Utilities
             return rv;
         }
 
+        public static byte[] Concatenate(byte[] a, byte[] b, byte[] c)
+        {
+                if (a != null && b != null && c != null)
+                {
+                        byte[] rv = new byte[a.Length + b.Length + c.Length];
+
+                        Array.Copy(a, 0, rv, 0, a.Length);
+                        Array.Copy(b, 0, rv, a.Length, b.Length);
+                      	Array.Copy(c, 0, rv, a.Length + b.Length, c.Length);
+
+                        return rv;
+                }
+                else if (b == null)
+                {
+                        return Concatenate(a, c);
+	        }
+                else
+                {
+                        return Concatenate(a, b);
+                }
+        }
+
         public static int[] Concatenate(int[] a, int[] b)
         {
             if (a == null)