MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / TestChaCha20

Function TestChaCha20

src/test/crypto_tests.cpp:190–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190static void TestChaCha20(const std::string &hexkey, uint64_t nonce, uint64_t seek, const std::string& hexout)
191{
192 std::vector<unsigned char> key = ParseHex(hexkey);
193 ChaCha20 rng(key.data(), key.size());
194 rng.SetIV(nonce);
195 rng.Seek(seek);
196 std::vector<unsigned char> out = ParseHex(hexout);
197 std::vector<unsigned char> outres;
198 outres.resize(out.size());
199 rng.Output(outres.data(), outres.size());
200 BOOST_CHECK(out == outres);
201}
202
203static std::string LongTestString(void) {
204 std::string ret;

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 7

ParseHexFunction · 0.85
SetIVMethod · 0.80
OutputMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45
SeekMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected