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

Function TestAES256

src/test/crypto_tests.cpp:89–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89static void TestAES256(const std::string &hexkey, const std::string &hexin, const std::string &hexout)
90{
91 std::vector<unsigned char> key = ParseHex(hexkey);
92 std::vector<unsigned char> in = ParseHex(hexin);
93 std::vector<unsigned char> correctout = ParseHex(hexout);
94 std::vector<unsigned char> buf;
95
96 assert(key.size() == 32);
97 assert(in.size() == 16);
98 assert(correctout.size() == 16);
99 AES256Encrypt enc(key.data());
100 buf.resize(correctout.size());
101 enc.Encrypt(buf.data(), in.data());
102 BOOST_CHECK(buf == correctout);
103 AES256Decrypt dec(key.data());
104 dec.Decrypt(buf.data(), buf.data());
105 BOOST_CHECK(buf == in);
106}
107
108static void TestAES128CBC(const std::string &hexkey, const std::string &hexiv, bool pad, const std::string &hexin, const std::string &hexout)
109{

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 6

ParseHexFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45
resizeMethod · 0.45
EncryptMethod · 0.45
DecryptMethod · 0.45

Tested by

no test coverage detected