24 #include "../crypto/internal.h"
25 #include "../crypto/test/file_test.h"
26 #include "../crypto/test/test_util.h"
32 if (!t->GetInstruction(&mod_str,
"mod") ||
33 !t->GetInstruction(&
table,
"Table for M-R Test") ||
35 !t->GetAttribute(&count_str,
"N")) {
39 printf(
"[mod = %s]\r\n", mod_str.c_str());
40 printf(
"[Table for M-R Test = %s]\r\n\r\n",
table.c_str());
42 size_t bits = strtoul(mod_str.c_str(),
nullptr, 0);
43 size_t count = strtoul(count_str.c_str(),
nullptr, 0);
59 BN_bn2bin(
n, n_bytes.data()) != n_bytes.size() ||
61 BN_bn2bin(e, e_bytes.data()) != e_bytes.size() ||
65 BN_bn2bin(
p, p_bytes.data()) != p_bytes.size() ||
67 BN_bn2bin(q, q_bytes.data()) != q_bytes.size()) {
71 printf(
"e = %s\r\np = %s\r\nq = %s\r\nn = %s\r\nd = %s\r\n\r\n",
82 fprintf(
stderr,
"usage: %s <test file>\n",