summary refs log tree commit diff
path: root/crypto/src/util
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2014-02-25 17:16:34 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2014-02-25 17:16:34 +0700
commita6039dfa9392ca64a3b0efe591aaf7b8441d13fc (patch)
tree8fcf9779569fe77fd0e65757ccce44345fc6fa92 /crypto/src/util
parentCheck a few more points in the encoding test (diff)
downloadBouncyCastle.NET-ed25519-a6039dfa9392ca64a3b0efe591aaf7b8441d13fc.tar.xz
Port some openpgp updates from Java build for secret keys
Diffstat (limited to 'crypto/src/util')
-rw-r--r--crypto/src/util/Arrays.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/crypto/src/util/Arrays.cs b/crypto/src/util/Arrays.cs
index 3632587de..cc2025ef3 100644
--- a/crypto/src/util/Arrays.cs
+++ b/crypto/src/util/Arrays.cs
@@ -329,5 +329,18 @@ namespace Org.BouncyCastle.Utilities
             Array.Copy(data, off, result, 0, len);
             return result;
         }
+
+        public static byte[] Concatenate(byte[] a, byte[] b)
+        {
+            if (a == null)
+                return Clone(b);
+            if (b == null)
+                return Clone(a);
+
+            byte[] rv = new byte[a.Length + b.Length];
+            Array.Copy(a, 0, rv, 0, a.Length);
+            Array.Copy(b, 0, rv, a.Length, b.Length);
+            return rv;
+        }
     }
 }