From 7f43ba84bd30b99d0e957920aa660a45f998c522 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sat, 5 Nov 2022 15:40:09 +0700 Subject: Port OpenPGP support for XDH, EdDSA from bc-java - see https://github.com/bcgit/bc-csharp/issues/345 --- crypto/src/util/Arrays.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'crypto/src/util/Arrays.cs') 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[] 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) -- cgit 1.5.1