diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-11-05 15:40:09 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-11-05 15:40:09 +0700 |
commit | 7f43ba84bd30b99d0e957920aa660a45f998c522 (patch) | |
tree | 7c6f4738d69ab3def1416c397752a3b63b66738f /crypto/src/util | |
parent | Update package icon (diff) | |
download | BouncyCastle.NET-ed25519-7f43ba84bd30b99d0e957920aa660a45f998c522.tar.xz |
Port OpenPGP support for XDH, EdDSA from bc-java
- see https://github.com/bcgit/bc-csharp/issues/345
Diffstat (limited to 'crypto/src/util')
-rw-r--r-- | crypto/src/util/Arrays.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crypto/src/util/Arrays.cs b/crypto/src/util/Arrays.cs index 936e510be..8b10ae6a3 100644 --- a/crypto/src/util/Arrays.cs +++ b/crypto/src/util/Arrays.cs @@ -884,6 +884,17 @@ namespace Org.BouncyCastle.Utilities return result; } + public static T[] Prepend<T>(T[] a, T b) + { + if (a == null) + return new T[1]{ b }; + + T[] result = new T[1 + a.Length]; + result[0] = b; + a.CopyTo(result, 1); + return result; + } + public static byte[] Reverse(byte[] a) { if (a == null) |