MCPcopy Create free account
hub / github.com/ElementsProject/elements / TestPoly1305

Function TestPoly1305

src/test/crypto_tests.cpp:165–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165static void TestPoly1305(const std::string &hexmessage, const std::string &hexkey, const std::string& hextag)
166{
167 std::vector<unsigned char> key = ParseHex(hexkey);
168 std::vector<unsigned char> m = ParseHex(hexmessage);
169 std::vector<unsigned char> tag = ParseHex(hextag);
170 std::vector<unsigned char> tagres;
171 tagres.resize(POLY1305_TAGLEN);
172 poly1305_auth(tagres.data(), m.data(), m.size(), key.data());
173 BOOST_CHECK(tag == tagres);
174}
175
176static void TestHKDF_SHA256_32(const std::string &ikm_hex, const std::string &salt_hex, const std::string &info_hex, const std::string &okm_check_hex) {
177 std::vector<unsigned char> initial_key_material = ParseHex(ikm_hex);

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 5

ParseHexFunction · 0.85
poly1305_authFunction · 0.85
resizeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected