diff options
author | subtly <subtly@users.noreply.github.com> | 2014-10-19 05:01:42 +0800 |
---|---|---|
committer | subtly <subtly@users.noreply.github.com> | 2014-10-19 05:01:42 +0800 |
commit | 8669468cbc18dfe0a7dd2049ff7e9662fc914fc3 (patch) | |
tree | d23cb2f7b40c727fd18e05e459dc6fc2aa9e1992 | |
parent | 224f43bf81b5cf7e54b0bdf95cd87e2d46bdb081 (diff) | |
download | dexon-solidity-8669468cbc18dfe0a7dd2049ff7e9662fc914fc3.tar.gz dexon-solidity-8669468cbc18dfe0a7dd2049ff7e9662fc914fc3.tar.zst dexon-solidity-8669468cbc18dfe0a7dd2049ff7e9662fc914fc3.zip |
cleanup headers
-rw-r--r-- | crypto.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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()); } |