diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-02-25 17:16:34 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2014-02-25 17:16:34 +0700 |
commit | a6039dfa9392ca64a3b0efe591aaf7b8441d13fc (patch) | |
tree | 8fcf9779569fe77fd0e65757ccce44345fc6fa92 /crypto/src/util/Arrays.cs | |
parent | Check a few more points in the encoding test (diff) | |
download | BouncyCastle.NET-ed25519-a6039dfa9392ca64a3b0efe591aaf7b8441d13fc.tar.xz |
Port some openpgp updates from Java build for secret keys
Diffstat (limited to 'crypto/src/util/Arrays.cs')
-rw-r--r-- | crypto/src/util/Arrays.cs | 13 |
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; + } } } |