23 #include "../crypto/test/file_test.h"
24 #include "../crypto/test/test_util.h"
36 TestCtx *
ctx =
reinterpret_cast<TestCtx *
>(
arg);
45 if (!t->GetInstruction(&out_len,
"L") ||
46 md_len != strtoul(out_len.c_str(),
nullptr, 0)) {
51 std::vector<uint8_t>
msg;
52 if (!t->GetAttribute(&msg_len_str,
"Len") ||
53 !t->GetBytes(&
msg,
"Msg")) {
57 size_t msg_len = strtoul(msg_len_str.c_str(),
nullptr, 0);
58 if (msg_len % 8 != 0 ||
59 msg_len / 8 >
msg.size()) {
64 std::vector<uint8_t>
out;
68 digest_len !=
out.size()) {
72 printf(
"%s", t->CurrentTestToString().c_str());
79 fprintf(
stderr,
"usage: %s <hash> <test file>\n",
arg);
85 return usage(argv[0]);