summary refs log tree commit diff
path: root/crypto/test
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2016-01-12 20:51:14 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2016-01-12 20:51:14 +0700
commit6362b19ea18de8c553fbe4998a2cc88413a1361b (patch)
tree53eeddaf641718b828bd189e79afacf8348e6511 /crypto/test
parentUpdate versions and release notes for release 1.8.1 (diff)
downloadBouncyCastle.NET-ed25519-6362b19ea18de8c553fbe4998a2cc88413a1361b.tar.xz
Use utility method
Diffstat (limited to 'crypto/test')
-rw-r--r--crypto/test/src/crypto/test/GcmReorderTest.cs16
1 files changed, 4 insertions, 12 deletions
diff --git a/crypto/test/src/crypto/test/GcmReorderTest.cs b/crypto/test/src/crypto/test/GcmReorderTest.cs
index 54d17f4f4..9694216f2 100644
--- a/crypto/test/src/crypto/test/GcmReorderTest.cs
+++ b/crypto/test/src/crypto/test/GcmReorderTest.cs
@@ -52,7 +52,7 @@ namespace Org.BouncyCastle.Crypto.Tests
 			{
 				byte[] P = randomBlocks(100);
 				byte[] A = randomBytes(1000);
-				byte[] PA = concatArrays(P, A);
+				byte[] PA = Arrays.Concatenate(P, A);
 
 				byte[] ghashP_ = GHASH(P, Empty);
 				byte[] ghashA_ = GHASH(A, Empty);
@@ -63,14 +63,14 @@ namespace Org.BouncyCastle.Crypto.Tests
 			}
 		}
 
-		[Test]
+        [Test]
 		public void TestConcatCrypt()
 		{
 			for (int count = 0; count < 10; ++count)
 			{
 				byte[] P = randomBlocks(100);
 				byte[] A = randomBytes(1000);
-				byte[] PA = concatArrays(P, A);
+                byte[] PA = Arrays.Concatenate(P, A);
 
 				byte[] ghash_P = GHASH(Empty, P);
 				byte[] ghash_A = GHASH(Empty, A);
@@ -177,15 +177,7 @@ namespace Org.BouncyCastle.Crypto.Tests
 			return bs;
 		}
 
-		private byte[] concatArrays(byte[] a, byte[] b)
-		{
-			byte[] ab = new byte[a.Length + b.Length];
-			Array.Copy(a, 0, ab, 0, a.Length);
-			Array.Copy(b, 0, ab, a.Length, b.Length);
-			return ab;
-		}
-
-		private byte[] combine_GHASH(byte[] ghashA_, long bitlenA, byte[] ghash_C, long bitlenC)
+        private byte[] combine_GHASH(byte[] ghashA_, long bitlenA, byte[] ghash_C, long bitlenC)
 		{
 			// Note: bitlenA must be aligned to the block size