summary refs log tree commit diff
path: root/crypto/src/util/Arrays.cs
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2014-01-21 16:46:07 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2014-01-21 16:46:07 +0700
commit95c58fd065df852598412fa8b7d06c3cee72c29c (patch)
tree01d8a520a72b008656881a37ec88d0ab2c98c361 /crypto/src/util/Arrays.cs
parentMerge branch 'pkix-validator-throw' of git://github.com/jstedfast/bc-csharp i... (diff)
parentPort HMac optimisation using Memoable digests from bc-java. (diff)
downloadBouncyCastle.NET-ed25519-95c58fd065df852598412fa8b7d06c3cee72c29c.tar.xz
Merge branch 'feature/threefish-skein-memoable-sm3' of git://github.com/timw/bc-csharp into timw-feature/threefish-skein-memoable-sm3
Conflicts:
	crypto/crypto.mdp
	crypto/src/util/Arrays.cs
Diffstat (limited to 'crypto/src/util/Arrays.cs')
-rw-r--r--crypto/src/util/Arrays.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crypto/src/util/Arrays.cs b/crypto/src/util/Arrays.cs

index 5eab42bd7..d90bbdd90 100644 --- a/crypto/src/util/Arrays.cs +++ b/crypto/src/util/Arrays.cs
@@ -236,6 +236,30 @@ namespace Org.BouncyCastle.Utilities } } + [CLSCompliantAttribute(false)] + public static ulong[] Clone( + ulong[] data) + { + return data == null ? null : (ulong[]) data.Clone(); + } + + [CLSCompliantAttribute(false)] + public static ulong[] Clone( + ulong[] data, + ulong[] existing) + { + if (data == null) + { + return null; + } + if ((existing == null) || (existing.Length != data.Length)) + { + return Clone(data); + } + Array.Copy(data, 0, existing, 0, existing.Length); + return existing; + } + public static byte[] Copy(byte[] data, int off, int len) { byte[] result = new byte[len];