Changeset View
Changeset View
Standalone View
Standalone View
src/test/crypto_tests.cpp
Show First 20 Lines • Show All 274 Lines • ▼ Show 20 Lines | std::string salt_stringified(reinterpret_cast<char *>(salt.data()), | ||||
salt.size()); | salt.size()); | ||||
std::string info_stringified(reinterpret_cast<char *>(info.data()), | std::string info_stringified(reinterpret_cast<char *>(info.data()), | ||||
info.size()); | info.size()); | ||||
CHKDF_HMAC_SHA256_L32 hkdf32(initial_key_material.data(), | CHKDF_HMAC_SHA256_L32 hkdf32(initial_key_material.data(), | ||||
initial_key_material.size(), salt_stringified); | initial_key_material.size(), salt_stringified); | ||||
uint8_t out[32]; | uint8_t out[32]; | ||||
hkdf32.Expand32(info_stringified, out); | hkdf32.Expand32(info_stringified, out); | ||||
BOOST_CHECK(HexStr(out, out + 32) == okm_check_hex); | BOOST_CHECK(HexStr(out) == okm_check_hex); | ||||
} | } | ||||
static std::string LongTestString() { | 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); | ||||
▲ Show 20 Lines • Show All 782 Lines • Show Last 20 Lines |