diff options
Diffstat (limited to 'crypto/src/util/Arrays.cs')
-rw-r--r-- | crypto/src/util/Arrays.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crypto/src/util/Arrays.cs b/crypto/src/util/Arrays.cs index b206d3144..d7227df2b 100644 --- a/crypto/src/util/Arrays.cs +++ b/crypto/src/util/Arrays.cs @@ -600,6 +600,12 @@ namespace Org.BouncyCastle.Utilities Array.Copy(data, 0, tmp, 0, System.Math.Min(newLength, data.Length)); return tmp; } + public static uint[] CopyOf(uint[] data, int newLength) + { + uint[] tmp = new uint[newLength]; + Array.Copy(data, 0, tmp, 0, System.Math.Min(newLength, data.Length)); + return tmp; + } public static long[] CopyOf(long[] data, int newLength) { @@ -770,6 +776,19 @@ namespace Org.BouncyCastle.Utilities Array.Copy(b, 0, rv, a.Length, b.Length); return rv; } + + public static uint[] Concatenate(uint[] a, uint[] b) + { + if (a == null) + return Clone(b); + if (b == null) + return Clone(a); + + uint[] rv = new uint[a.Length + b.Length]; + Array.Copy(a, 0, rv, 0, a.Length); + Array.Copy(b, 0, rv, a.Length, b.Length); + return rv; + } public static byte[] Prepend(byte[] a, byte b) { |