25 #include "../crypto/internal.h"
26 #include "../crypto/test/file_test.h"
27 #include "../crypto/test/test_util.h"
33 bssl::UniquePtr<RSA>
key;
40 TestCtx *
ctx =
reinterpret_cast<TestCtx *
>(
arg);
43 std::vector<uint8_t>
msg;
44 if (!t->GetInstruction(&mod_str,
"mod") ||
45 !t->GetAttribute(&
hash,
"SHAAlg") ||
46 !t->GetBytes(&
msg,
"Msg")) {
51 if (t->IsAtNewInstructionBlock()) {
52 int mod_bits = strtoul(mod_str.c_str(),
nullptr, 0);
54 if (
ctx->key ==
nullptr ||
70 printf(
"[mod = %s]\r\n\r\nn = %s\r\n\r\ne = %s", mod_str.c_str(),
87 digest_buf, digest_len,
md,
md, -1)) {
93 &sig_len_u,
ctx->key.get())) {
106 fprintf(
stderr,
"usage: %s (pkcs15|pss) <test file>\n",
112 if (strcmp(argv[1],
"pkcs15") == 0) {
113 ctx = {
nullptr,
false};
114 }
else if (strcmp(argv[1],
"pss") == 0) {
115 ctx = {
nullptr,
true};
117 fprintf(
stderr,
"Unknown test type: %s\n", argv[1]);