mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
cleanup headers
This commit is contained in:
parent
224f43bf81
commit
8669468cbc
@ -43,12 +43,16 @@ BOOST_AUTO_TEST_CASE(ecies)
|
|||||||
ECKeyPair k = ECKeyPair::create();
|
ECKeyPair k = ECKeyPair::create();
|
||||||
|
|
||||||
string message("Now is the time for all good men to come to the aide of humanity.");
|
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);
|
ECIESEncryptor(&k).encrypt(b);
|
||||||
|
|
||||||
bytesConstRef br(&b);
|
bytesConstRef br(&b);
|
||||||
bytes plain = ECIESDecryptor(&k).decrypt(br);
|
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());
|
assert(plain == bytesConstRef(message).toBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user