From 6362b19ea18de8c553fbe4998a2cc88413a1361b Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 12 Jan 2016 20:51:14 +0700 Subject: Use utility method --- crypto/test/src/crypto/test/GcmReorderTest.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'crypto') 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 -- cgit 1.5.1