Changeset View
Changeset View
Standalone View
Standalone View
src/test/crypto_tests.cpp
Show First 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | static void TestChaCha20(const std::string &hexkey, uint64_t nonce, | ||||
rng.Seek(seek); | rng.Seek(seek); | ||||
std::vector<uint8_t> out = ParseHex(hexout); | std::vector<uint8_t> out = ParseHex(hexout); | ||||
std::vector<uint8_t> outres; | std::vector<uint8_t> outres; | ||||
outres.resize(out.size()); | outres.resize(out.size()); | ||||
rng.Output(outres.data(), outres.size()); | rng.Output(outres.data(), outres.size()); | ||||
BOOST_CHECK(out == outres); | BOOST_CHECK(out == outres); | ||||
} | } | ||||
static std::string LongTestString(void) { | static std::string LongTestString() { | ||||
std::string ret; | std::string ret; | ||||
for (int i = 0; i < 200000; i++) { | for (int i = 0; i < 200000; i++) { | ||||
ret += uint8_t(i); | ret += uint8_t(i); | ||||
ret += uint8_t(i >> 4); | ret += uint8_t(i >> 4); | ||||
ret += uint8_t(i >> 8); | ret += uint8_t(i >> 8); | ||||
ret += uint8_t(i >> 12); | ret += uint8_t(i >> 12); | ||||
ret += uint8_t(i >> 16); | ret += uint8_t(i >> 16); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 460 Lines • Show Last 20 Lines |