diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-08-14 22:18:12 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-08-14 22:18:12 +0700 |
commit | 324743238cb12cedec2cd4f0ac08b0aa8ca886e4 (patch) | |
tree | f2f853dce8d2aeb926cdfdbb3aa2512919caef96 | |
parent | Fix namespace declaration (diff) | |
download | BouncyCastle.NET-ed25519-324743238cb12cedec2cd4f0ac08b0aa8ca886e4.tar.xz |
Fix the message in case of test failure
-rw-r--r-- | crypto/test/src/crypto/test/DSTU7624Test.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/test/src/crypto/test/DSTU7624Test.cs b/crypto/test/src/crypto/test/DSTU7624Test.cs index 2aa65f8c4..234474db6 100644 --- a/crypto/test/src/crypto/test/DSTU7624Test.cs +++ b/crypto/test/src/crypto/test/DSTU7624Test.cs @@ -185,10 +185,11 @@ namespace Org.BouncyCastle.Crypto.Tests wrapper.Init(false, new KeyParameter(key)); output = wrapper.Unwrap(output, textB.Length, output.Length - textB.Length - textA.Length); - if (!Arrays.AreEqual(output, Arrays.CopyOfRange(textToWrap, textA.Length, textToWrap.Length - textB.Length))) + byte[] expected = Arrays.CopyOfRange(textToWrap, textA.Length, textToWrap.Length - textB.Length); + if (!Arrays.AreEqual(output, expected)) { return new SimpleTestResult(false, Name + ": Failed KW (unwrapping) test 1 - expected " - + Hex.ToHexString(textToWrap) + + Hex.ToHexString(expected) + " got " + Hex.ToHexString(output)); } |