diff options
author | David Hook <dgh@cryptoworkshop.com> | 2015-11-16 10:08:38 +1100 |
---|---|---|
committer | David Hook <dgh@cryptoworkshop.com> | 2015-11-16 10:08:38 +1100 |
commit | 20e56efe5b9d6b1f27007c92166114f50c9ee163 (patch) | |
tree | 7ac14bd154d12a7a2693691c37066a14b1dcbbc9 | |
parent | Check in our strong name key (diff) | |
download | BouncyCastle.NET-ed25519-20e56efe5b9d6b1f27007c92166114f50c9ee163.tar.xz |
added 3[] Concatenate
-rw-r--r-- | crypto/src/util/Arrays.cs | 22 |
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) |