summary refs log tree commit diff
path: root/crypto/src/util
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2023-04-20 18:40:56 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2023-04-20 18:40:56 +0700
commit758b05345c9d2f0b412f75435cb31231a7f70311 (patch)
tree5600970e299bc813a44ee48d2e3c8ba8eca9572d /crypto/src/util
parentBigInteger construction from little-endian (diff)
downloadBouncyCastle.NET-ed25519-758b05345c9d2f0b412f75435cb31231a7f70311.tar.xz
Refactoring: reduced allocations
Diffstat (limited to 'crypto/src/util')
-rw-r--r--crypto/src/util/Arrays.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/src/util/Arrays.cs b/crypto/src/util/Arrays.cs
index 83fafb388..f99065512 100644
--- a/crypto/src/util/Arrays.cs
+++ b/crypto/src/util/Arrays.cs
@@ -958,6 +958,15 @@ namespace Org.BouncyCastle.Utilities
             return result;
         }
 
+        internal static void Reverse<T>(T[] input, T[] output)
+        {
+            int last = input.Length - 1;
+            for (int i = 0; i <= last; ++i)
+            {
+                output[i] = input[last - i];
+            }
+        }
+
         public static T[] ReverseInPlace<T>(T[] array)
         {
             if (null == array)