Browse Source

minor test fixes.

Ugochukwu Mmaduekwe 6 years ago
parent
commit
c159bd5832
1 changed files with 5 additions and 3 deletions
  1. 5 3
      CryptoLib.Tests/src/Math/PascalCoinECIESTests.pas

+ 5 - 3
CryptoLib.Tests/src/Math/PascalCoinECIESTests.pas

@@ -62,7 +62,8 @@ type
 type
 
   /// <summary>
-  /// test for PascalCoinECIES - PascalCoin Elliptic Curve Integrated Encryption Scheme
+  /// Test for PascalCoin ECIES - PascalCoin Elliptic Curve Integrated Encryption Scheme
+  /// Test vectors were gotten from the PascalCoin TESTNET Wallet.
   /// </summary>
   TTestPascalCoinECIES = class(TCryptoLibTestCase)
   private
@@ -264,9 +265,10 @@ begin
     CipherDecrypt.Init(False, RecreatePrivateKeyFromByteArray(keyType,
       THex.Decode(RawPrivateKey)), GetPascalCoinIESParameterSpec(), FRandom);
     Result := String(TEncoding.ASCII.GetString
-      ((System.Copy(CipherDecrypt.DoFinal(THex.Decode(PayloadToDecrypt))))));
+      ((CipherDecrypt.DoFinal(THex.Decode(PayloadToDecrypt)))));
   except
     // should only happen if decryption fails
+    raise;
   end;
 end;
 
@@ -279,7 +281,7 @@ begin
   DecryptedPayload := DoPascalCoinECIESDecrypt(keyType, RawPrivateKey,
     PayloadToDecrypt);
   CheckEquals(ExpectedOutput, DecryptedPayload,
-    Format('Test %s Failed, Expected "%s" but got "%s"', [id + '_Encrypt',
+    Format('Test %s Failed, Expected "%s" but got "%s"', [id + '_Decrypt',
     ExpectedOutput, DecryptedPayload]));
 end;