aboutsummaryrefslogtreecommitdiffstats
path: root/crypto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'crypto.cpp')
-rw-r--r--crypto.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/crypto.cpp b/crypto.cpp
index 428fcb27..484b8714 100644
--- a/crypto.cpp
+++ b/crypto.cpp
@@ -41,14 +41,18 @@ BOOST_AUTO_TEST_SUITE(devcrypto)
BOOST_AUTO_TEST_CASE(ecies)
{
ECKeyPair k = ECKeyPair::create();
-
+
string message("Now is the time for all good men to come to the aide of humanity.");
- bytes b = bytesConstRef(message).toBytes();
+ bytes b = bytesRef(message).toBytes();
ECIESEncryptor(&k).encrypt(b);
bytesConstRef br(&b);
bytes plain = ECIESDecryptor(&k).decrypt(br);
+
+ // ideally, decryptor will go a step further, accept a bytesRef and zero input.
+ assert(plain != b);
+ // plaintext is same as output
assert(plain == bytesConstRef(message).toBytes());
}