22 #include <boost/test/unit_test.hpp> 36 for (
int j = 0; j < 8; ++j)
49 int const sz = rand() % 1024;
50 for (
int j = 0; j < sz; ++j)
51 ret.push_back(rand() % 256);
60 BOOST_REQUIRE_EQUAL(p1.size(), p2.size());
62 for (
size_t i = 0; i < p1.size(); ++i)
63 BOOST_REQUIRE_EQUAL(p1[i], p2[i]);
74 for (
auto const& t: topics)
77 singleTopic.push_back(t);
78 Message m2(e, singleTopic, zero);
void sealAndOpenSingleMessage(unsigned int i)
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
bytes createRandomPayload(unsigned int i)
Topics createRandomTopics(unsigned int i)
std::hash for asio::adress
bytes const & payload() const
std::vector< byte > bytes
#define BOOST_FIXTURE_TEST_SUITE(a, b)
An (unencrypted) message, constructed from the combination of an Envelope, and, potentially, a Secret key to decrypt the Message.
bool sha3(bytesConstRef _input, bytesRef o_output)
Calculate SHA3-256 hash of the given input and load it into the given output.
#define BOOST_AUTO_TEST_SUITE_END()
Envelope seal(Secret const &_from, Topics const &_topics, unsigned _ttl=50, unsigned _workToProve=50) const
Turn this message into a ditributable Envelope.
Helper functions to work with json::spirit and test files.
void comparePayloads(Message const &m1, Message const &m2)