Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

578 строки
18 KiB

  1. /*
  2. * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
  3. * project.
  4. */
  5. /* ====================================================================
  6. * Copyright (c) 2015 The OpenSSL Project. All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. *
  15. * 2. Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in
  17. * the documentation and/or other materials provided with the
  18. * distribution.
  19. *
  20. * 3. All advertising materials mentioning features or use of this
  21. * software must display the following acknowledgment:
  22. * "This product includes software developed by the OpenSSL Project
  23. * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
  24. *
  25. * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
  26. * endorse or promote products derived from this software without
  27. * prior written permission. For written permission, please contact
  28. * licensing@OpenSSL.org.
  29. *
  30. * 5. Products derived from this software may not be called "OpenSSL"
  31. * nor may "OpenSSL" appear in their names without prior written
  32. * permission of the OpenSSL Project.
  33. *
  34. * 6. Redistributions of any form whatsoever must retain the following
  35. * acknowledgment:
  36. * "This product includes software developed by the OpenSSL Project
  37. * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
  38. *
  39. * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
  40. * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  41. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  42. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
  43. * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  44. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  45. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  46. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  47. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  48. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  49. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  50. * OF THE POSSIBILITY OF SUCH DAMAGE.
  51. * ====================================================================
  52. */
  53. #include <openssl/evp.h>
  54. #include <stdio.h>
  55. #include <stdint.h>
  56. #include <stdlib.h>
  57. #include <string.h>
  58. OPENSSL_MSVC_PRAGMA(warning(push))
  59. OPENSSL_MSVC_PRAGMA(warning(disable: 4702))
  60. #include <map>
  61. #include <string>
  62. #include <utility>
  63. #include <vector>
  64. OPENSSL_MSVC_PRAGMA(warning(pop))
  65. #include <gtest/gtest.h>
  66. #include <openssl/buf.h>
  67. #include <openssl/bytestring.h>
  68. #include <openssl/crypto.h>
  69. #include <openssl/digest.h>
  70. #include <openssl/dsa.h>
  71. #include <openssl/err.h>
  72. #include <openssl/rsa.h>
  73. #include "../test/file_test.h"
  74. #include "../test/test_util.h"
  75. #include "../test/wycheproof_util.h"
  76. // evp_test dispatches between multiple test types. PrivateKey tests take a key
  77. // name parameter and single block, decode it as a PEM private key, and save it
  78. // under that key name. Decrypt, Sign, and Verify tests take a previously
  79. // imported key name as parameter and test their respective operations.
  80. static const EVP_MD *GetDigest(FileTest *t, const std::string &name) {
  81. if (name == "MD5") {
  82. return EVP_md5();
  83. } else if (name == "SHA1") {
  84. return EVP_sha1();
  85. } else if (name == "SHA224") {
  86. return EVP_sha224();
  87. } else if (name == "SHA256") {
  88. return EVP_sha256();
  89. } else if (name == "SHA384") {
  90. return EVP_sha384();
  91. } else if (name == "SHA512") {
  92. return EVP_sha512();
  93. }
  94. ADD_FAILURE() << "Unknown digest: " << name;
  95. return nullptr;
  96. }
  97. static int GetKeyType(FileTest *t, const std::string &name) {
  98. if (name == "RSA") {
  99. return EVP_PKEY_RSA;
  100. }
  101. if (name == "EC") {
  102. return EVP_PKEY_EC;
  103. }
  104. if (name == "DSA") {
  105. return EVP_PKEY_DSA;
  106. }
  107. if (name == "Ed25519") {
  108. return EVP_PKEY_ED25519;
  109. }
  110. ADD_FAILURE() << "Unknown key type: " << name;
  111. return EVP_PKEY_NONE;
  112. }
  113. static int GetRSAPadding(FileTest *t, int *out, const std::string &name) {
  114. if (name == "PKCS1") {
  115. *out = RSA_PKCS1_PADDING;
  116. return true;
  117. }
  118. if (name == "PSS") {
  119. *out = RSA_PKCS1_PSS_PADDING;
  120. return true;
  121. }
  122. if (name == "OAEP") {
  123. *out = RSA_PKCS1_OAEP_PADDING;
  124. return true;
  125. }
  126. ADD_FAILURE() << "Unknown RSA padding mode: " << name;
  127. return false;
  128. }
  129. using KeyMap = std::map<std::string, bssl::UniquePtr<EVP_PKEY>>;
  130. static bool ImportKey(FileTest *t, KeyMap *key_map,
  131. EVP_PKEY *(*parse_func)(CBS *cbs),
  132. int (*marshal_func)(CBB *cbb, const EVP_PKEY *key)) {
  133. std::vector<uint8_t> input;
  134. if (!t->GetBytes(&input, "Input")) {
  135. return false;
  136. }
  137. CBS cbs;
  138. CBS_init(&cbs, input.data(), input.size());
  139. bssl::UniquePtr<EVP_PKEY> pkey(parse_func(&cbs));
  140. if (!pkey) {
  141. return false;
  142. }
  143. std::string key_type;
  144. if (!t->GetAttribute(&key_type, "Type")) {
  145. return false;
  146. }
  147. EXPECT_EQ(GetKeyType(t, key_type), EVP_PKEY_id(pkey.get()));
  148. // The key must re-encode correctly.
  149. bssl::ScopedCBB cbb;
  150. uint8_t *der;
  151. size_t der_len;
  152. if (!CBB_init(cbb.get(), 0) ||
  153. !marshal_func(cbb.get(), pkey.get()) ||
  154. !CBB_finish(cbb.get(), &der, &der_len)) {
  155. return false;
  156. }
  157. bssl::UniquePtr<uint8_t> free_der(der);
  158. std::vector<uint8_t> output = input;
  159. if (t->HasAttribute("Output") &&
  160. !t->GetBytes(&output, "Output")) {
  161. return false;
  162. }
  163. EXPECT_EQ(Bytes(output), Bytes(der, der_len)) << "Re-encoding the key did not match.";
  164. // Save the key for future tests.
  165. const std::string &key_name = t->GetParameter();
  166. EXPECT_EQ(0u, key_map->count(key_name)) << "Duplicate key: " << key_name;
  167. (*key_map)[key_name] = std::move(pkey);
  168. return true;
  169. }
  170. // SetupContext configures |ctx| based on attributes in |t|, with the exception
  171. // of the signing digest which must be configured externally.
  172. static bool SetupContext(FileTest *t, EVP_PKEY_CTX *ctx) {
  173. if (t->HasAttribute("RSAPadding")) {
  174. int padding;
  175. if (!GetRSAPadding(t, &padding, t->GetAttributeOrDie("RSAPadding")) ||
  176. !EVP_PKEY_CTX_set_rsa_padding(ctx, padding)) {
  177. return false;
  178. }
  179. }
  180. if (t->HasAttribute("PSSSaltLength") &&
  181. !EVP_PKEY_CTX_set_rsa_pss_saltlen(
  182. ctx, atoi(t->GetAttributeOrDie("PSSSaltLength").c_str()))) {
  183. return false;
  184. }
  185. if (t->HasAttribute("MGF1Digest")) {
  186. const EVP_MD *digest = GetDigest(t, t->GetAttributeOrDie("MGF1Digest"));
  187. if (digest == nullptr || !EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, digest)) {
  188. return false;
  189. }
  190. }
  191. if (t->HasAttribute("OAEPDigest")) {
  192. const EVP_MD *digest = GetDigest(t, t->GetAttributeOrDie("OAEPDigest"));
  193. if (digest == nullptr || !EVP_PKEY_CTX_set_rsa_oaep_md(ctx, digest)) {
  194. return false;
  195. }
  196. }
  197. if (t->HasAttribute("OAEPLabel")) {
  198. std::vector<uint8_t> label;
  199. if (!t->GetBytes(&label, "OAEPLabel")) {
  200. return false;
  201. }
  202. // For historical reasons, |EVP_PKEY_CTX_set0_rsa_oaep_label| expects to be
  203. // take ownership of the input.
  204. bssl::UniquePtr<uint8_t> buf(
  205. reinterpret_cast<uint8_t *>(BUF_memdup(label.data(), label.size())));
  206. if (!buf ||
  207. !EVP_PKEY_CTX_set0_rsa_oaep_label(ctx, buf.get(), label.size())) {
  208. return false;
  209. }
  210. buf.release();
  211. }
  212. return true;
  213. }
  214. static bool TestEVP(FileTest *t, KeyMap *key_map) {
  215. if (t->GetType() == "PrivateKey") {
  216. return ImportKey(t, key_map, EVP_parse_private_key,
  217. EVP_marshal_private_key);
  218. }
  219. if (t->GetType() == "PublicKey") {
  220. return ImportKey(t, key_map, EVP_parse_public_key, EVP_marshal_public_key);
  221. }
  222. int (*key_op_init)(EVP_PKEY_CTX *ctx) = nullptr;
  223. int (*key_op)(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *out_len,
  224. const uint8_t *in, size_t in_len) = nullptr;
  225. int (*md_op_init)(EVP_MD_CTX * ctx, EVP_PKEY_CTX * *pctx, const EVP_MD *type,
  226. ENGINE *e, EVP_PKEY *pkey) = nullptr;
  227. bool is_verify = false;
  228. if (t->GetType() == "Decrypt") {
  229. key_op_init = EVP_PKEY_decrypt_init;
  230. key_op = EVP_PKEY_decrypt;
  231. } else if (t->GetType() == "Sign") {
  232. key_op_init = EVP_PKEY_sign_init;
  233. key_op = EVP_PKEY_sign;
  234. } else if (t->GetType() == "Verify") {
  235. key_op_init = EVP_PKEY_verify_init;
  236. is_verify = true;
  237. } else if (t->GetType() == "SignMessage") {
  238. md_op_init = EVP_DigestSignInit;
  239. } else if (t->GetType() == "VerifyMessage") {
  240. md_op_init = EVP_DigestVerifyInit;
  241. is_verify = true;
  242. } else if (t->GetType() == "Encrypt") {
  243. key_op_init = EVP_PKEY_encrypt_init;
  244. key_op = EVP_PKEY_encrypt;
  245. } else {
  246. ADD_FAILURE() << "Unknown test " << t->GetType();
  247. return false;
  248. }
  249. // Load the key.
  250. const std::string &key_name = t->GetParameter();
  251. if (key_map->count(key_name) == 0) {
  252. ADD_FAILURE() << "Could not find key " << key_name;
  253. return false;
  254. }
  255. EVP_PKEY *key = (*key_map)[key_name].get();
  256. const EVP_MD *digest = nullptr;
  257. if (t->HasAttribute("Digest")) {
  258. digest = GetDigest(t, t->GetAttributeOrDie("Digest"));
  259. if (digest == nullptr) {
  260. return false;
  261. }
  262. }
  263. // For verify tests, the "output" is the signature. Read it now so that, for
  264. // tests which expect a failure in SetupContext, the attribute is still
  265. // consumed.
  266. std::vector<uint8_t> input, actual, output;
  267. if (!t->GetBytes(&input, "Input") ||
  268. (is_verify && !t->GetBytes(&output, "Output"))) {
  269. return false;
  270. }
  271. if (md_op_init) {
  272. bssl::ScopedEVP_MD_CTX ctx;
  273. EVP_PKEY_CTX *pctx;
  274. if (!md_op_init(ctx.get(), &pctx, digest, nullptr, key) ||
  275. !SetupContext(t, pctx)) {
  276. return false;
  277. }
  278. if (is_verify) {
  279. return !!EVP_DigestVerify(ctx.get(), output.data(), output.size(),
  280. input.data(), input.size());
  281. }
  282. size_t len;
  283. if (!EVP_DigestSign(ctx.get(), nullptr, &len, input.data(), input.size())) {
  284. return false;
  285. }
  286. actual.resize(len);
  287. if (!EVP_DigestSign(ctx.get(), actual.data(), &len, input.data(),
  288. input.size()) ||
  289. !t->GetBytes(&output, "Output")) {
  290. return false;
  291. }
  292. actual.resize(len);
  293. EXPECT_EQ(Bytes(output), Bytes(actual));
  294. return true;
  295. }
  296. bssl::UniquePtr<EVP_PKEY_CTX> ctx(EVP_PKEY_CTX_new(key, nullptr));
  297. if (!ctx ||
  298. !key_op_init(ctx.get()) ||
  299. (digest != nullptr &&
  300. !EVP_PKEY_CTX_set_signature_md(ctx.get(), digest)) ||
  301. !SetupContext(t, ctx.get())) {
  302. return false;
  303. }
  304. if (is_verify) {
  305. return !!EVP_PKEY_verify(ctx.get(), output.data(), output.size(),
  306. input.data(), input.size());
  307. }
  308. size_t len;
  309. if (!key_op(ctx.get(), nullptr, &len, input.data(), input.size())) {
  310. return false;
  311. }
  312. actual.resize(len);
  313. if (!key_op(ctx.get(), actual.data(), &len, input.data(), input.size())) {
  314. return false;
  315. }
  316. // Encryption is non-deterministic, so we check by decrypting.
  317. if (t->HasAttribute("CheckDecrypt")) {
  318. size_t plaintext_len;
  319. ctx.reset(EVP_PKEY_CTX_new(key, nullptr));
  320. if (!ctx ||
  321. !EVP_PKEY_decrypt_init(ctx.get()) ||
  322. (digest != nullptr &&
  323. !EVP_PKEY_CTX_set_signature_md(ctx.get(), digest)) ||
  324. !SetupContext(t, ctx.get()) ||
  325. !EVP_PKEY_decrypt(ctx.get(), nullptr, &plaintext_len, actual.data(),
  326. actual.size())) {
  327. return false;
  328. }
  329. output.resize(plaintext_len);
  330. if (!EVP_PKEY_decrypt(ctx.get(), output.data(), &plaintext_len,
  331. actual.data(), actual.size())) {
  332. ADD_FAILURE() << "Could not decrypt result.";
  333. return false;
  334. }
  335. output.resize(plaintext_len);
  336. EXPECT_EQ(Bytes(input), Bytes(output)) << "Decrypted result mismatch.";
  337. return true;
  338. }
  339. // Some signature schemes are non-deterministic, so we check by verifying.
  340. if (t->HasAttribute("CheckVerify")) {
  341. ctx.reset(EVP_PKEY_CTX_new(key, nullptr));
  342. if (!ctx ||
  343. !EVP_PKEY_verify_init(ctx.get()) ||
  344. (digest != nullptr &&
  345. !EVP_PKEY_CTX_set_signature_md(ctx.get(), digest)) ||
  346. !SetupContext(t, ctx.get())) {
  347. return false;
  348. }
  349. if (t->HasAttribute("VerifyPSSSaltLength") &&
  350. !EVP_PKEY_CTX_set_rsa_pss_saltlen(
  351. ctx.get(),
  352. atoi(t->GetAttributeOrDie("VerifyPSSSaltLength").c_str()))) {
  353. return false;
  354. }
  355. EXPECT_TRUE(EVP_PKEY_verify(ctx.get(), actual.data(), actual.size(),
  356. input.data(), input.size()))
  357. << "Could not verify result.";
  358. return true;
  359. }
  360. // By default, check by comparing the result against Output.
  361. if (!t->GetBytes(&output, "Output")) {
  362. return false;
  363. }
  364. actual.resize(len);
  365. EXPECT_EQ(Bytes(output), Bytes(actual));
  366. return true;
  367. }
  368. TEST(EVPTest, TestVectors) {
  369. KeyMap key_map;
  370. FileTestGTest("crypto/evp/evp_tests.txt", [&](FileTest *t) {
  371. bool result = TestEVP(t, &key_map);
  372. if (t->HasAttribute("Error")) {
  373. ASSERT_FALSE(result) << "Operation unexpectedly succeeded.";
  374. uint32_t err = ERR_peek_error();
  375. EXPECT_EQ(t->GetAttributeOrDie("Error"), ERR_reason_error_string(err));
  376. } else if (!result) {
  377. ADD_FAILURE() << "Operation unexpectedly failed.";
  378. }
  379. });
  380. }
  381. static void RunWycheproofTest(const char *path) {
  382. SCOPED_TRACE(path);
  383. FileTestGTest(path, [](FileTest *t) {
  384. t->IgnoreInstruction("key.type");
  385. // Extra ECDSA fields.
  386. t->IgnoreInstruction("key.curve");
  387. t->IgnoreInstruction("key.keySize");
  388. t->IgnoreInstruction("key.wx");
  389. t->IgnoreInstruction("key.wy");
  390. t->IgnoreInstruction("key.uncompressed");
  391. // Extra RSA fields.
  392. t->IgnoreInstruction("e");
  393. t->IgnoreInstruction("keyAsn");
  394. t->IgnoreInstruction("keysize");
  395. t->IgnoreInstruction("n");
  396. t->IgnoreAttribute("padding");
  397. // Extra EdDSA fields.
  398. t->IgnoreInstruction("key.pk");
  399. t->IgnoreInstruction("key.sk");
  400. // Extra DSA fields.
  401. t->IgnoreInstruction("key.g");
  402. t->IgnoreInstruction("key.p");
  403. t->IgnoreInstruction("key.q");
  404. t->IgnoreInstruction("key.y");
  405. std::vector<uint8_t> der;
  406. ASSERT_TRUE(t->GetInstructionBytes(&der, "keyDer"));
  407. CBS cbs;
  408. CBS_init(&cbs, der.data(), der.size());
  409. bssl::UniquePtr<EVP_PKEY> key(EVP_parse_public_key(&cbs));
  410. ASSERT_TRUE(key);
  411. const EVP_MD *md = nullptr;
  412. if (t->HasInstruction("sha")) {
  413. md = GetWycheproofDigest(t, "sha", true);
  414. ASSERT_TRUE(md);
  415. }
  416. bool is_pss = t->HasInstruction("mgf");
  417. const EVP_MD *mgf1_md = nullptr;
  418. int pss_salt_len = -1;
  419. if (is_pss) {
  420. ASSERT_EQ("MGF1", t->GetInstructionOrDie("mgf"));
  421. mgf1_md = GetWycheproofDigest(t, "mgfSha", true);
  422. std::string s_len;
  423. ASSERT_TRUE(t->GetInstruction(&s_len, "sLen"));
  424. pss_salt_len = atoi(s_len.c_str());
  425. }
  426. std::vector<uint8_t> msg;
  427. ASSERT_TRUE(t->GetBytes(&msg, "msg"));
  428. std::vector<uint8_t> sig;
  429. ASSERT_TRUE(t->GetBytes(&sig, "sig"));
  430. WycheproofResult result;
  431. ASSERT_TRUE(GetWycheproofResult(t, &result));
  432. if (EVP_PKEY_id(key.get()) == EVP_PKEY_DSA) {
  433. // DSA is deprecated and is not usable via EVP.
  434. DSA *dsa = EVP_PKEY_get0_DSA(key.get());
  435. uint8_t digest[EVP_MAX_MD_SIZE];
  436. unsigned digest_len;
  437. ASSERT_TRUE(
  438. EVP_Digest(msg.data(), msg.size(), digest, &digest_len, md, nullptr));
  439. int valid;
  440. bool sig_ok = DSA_check_signature(&valid, digest, digest_len, sig.data(),
  441. sig.size(), dsa) &&
  442. valid;
  443. if (result == WycheproofResult::kValid) {
  444. EXPECT_TRUE(sig_ok);
  445. } else if (result == WycheproofResult::kInvalid) {
  446. EXPECT_FALSE(sig_ok);
  447. } else {
  448. // this is a legacy signature, which may or may not be accepted.
  449. }
  450. } else {
  451. bssl::ScopedEVP_MD_CTX ctx;
  452. EVP_PKEY_CTX *pctx;
  453. ASSERT_TRUE(
  454. EVP_DigestVerifyInit(ctx.get(), &pctx, md, nullptr, key.get()));
  455. if (is_pss) {
  456. ASSERT_TRUE(EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PSS_PADDING));
  457. ASSERT_TRUE(EVP_PKEY_CTX_set_rsa_mgf1_md(pctx, mgf1_md));
  458. ASSERT_TRUE(EVP_PKEY_CTX_set_rsa_pss_saltlen(pctx, pss_salt_len));
  459. }
  460. int ret = EVP_DigestVerify(ctx.get(), sig.data(), sig.size(), msg.data(),
  461. msg.size());
  462. if (result == WycheproofResult::kValid) {
  463. EXPECT_EQ(1, ret);
  464. } else if (result == WycheproofResult::kInvalid) {
  465. EXPECT_EQ(0, ret);
  466. } else {
  467. // this is a legacy signature, which may or may not be accepted.
  468. EXPECT_TRUE(ret == 1 || ret == 0);
  469. }
  470. }
  471. });
  472. }
  473. TEST(EVPTest, WycheproofDSA) {
  474. RunWycheproofTest("third_party/wycheproof_testvectors/dsa_test.txt");
  475. }
  476. TEST(EVPTest, WycheproofECDSAP224) {
  477. RunWycheproofTest(
  478. "third_party/wycheproof_testvectors/ecdsa_secp224r1_sha224_test.txt");
  479. RunWycheproofTest(
  480. "third_party/wycheproof_testvectors/ecdsa_secp224r1_sha256_test.txt");
  481. RunWycheproofTest(
  482. "third_party/wycheproof_testvectors/ecdsa_secp224r1_sha512_test.txt");
  483. }
  484. TEST(EVPTest, WycheproofECDSAP256) {
  485. RunWycheproofTest(
  486. "third_party/wycheproof_testvectors/ecdsa_secp256r1_sha256_test.txt");
  487. RunWycheproofTest(
  488. "third_party/wycheproof_testvectors/ecdsa_secp256r1_sha512_test.txt");
  489. }
  490. TEST(EVPTest, WycheproofECDSAP384) {
  491. RunWycheproofTest(
  492. "third_party/wycheproof_testvectors/ecdsa_secp384r1_sha384_test.txt");
  493. }
  494. TEST(EVPTest, WycheproofECDSAP521) {
  495. RunWycheproofTest(
  496. "third_party/wycheproof_testvectors/ecdsa_secp384r1_sha512_test.txt");
  497. RunWycheproofTest(
  498. "third_party/wycheproof_testvectors/ecdsa_secp521r1_sha512_test.txt");
  499. }
  500. TEST(EVPTest, WycheproofEdDSA) {
  501. RunWycheproofTest("third_party/wycheproof_testvectors/eddsa_test.txt");
  502. }
  503. TEST(EVPTest, WycheproofRSAPKCS1) {
  504. RunWycheproofTest(
  505. "third_party/wycheproof_testvectors/rsa_signature_test.txt");
  506. }
  507. TEST(EVPTest, WycheproofRSAPSS) {
  508. RunWycheproofTest(
  509. "third_party/wycheproof_testvectors/rsa_pss_2048_sha1_mgf1_20_test.txt");
  510. RunWycheproofTest(
  511. "third_party/wycheproof_testvectors/rsa_pss_2048_sha256_mgf1_0_test.txt");
  512. RunWycheproofTest(
  513. "third_party/wycheproof_testvectors/"
  514. "rsa_pss_2048_sha256_mgf1_32_test.txt");
  515. RunWycheproofTest(
  516. "third_party/wycheproof_testvectors/"
  517. "rsa_pss_3072_sha256_mgf1_32_test.txt");
  518. RunWycheproofTest(
  519. "third_party/wycheproof_testvectors/"
  520. "rsa_pss_4096_sha256_mgf1_32_test.txt");
  521. RunWycheproofTest(
  522. "third_party/wycheproof_testvectors/"
  523. "rsa_pss_4096_sha512_mgf1_32_test.txt");
  524. RunWycheproofTest("third_party/wycheproof_testvectors/rsa_pss_misc_test.txt");
  525. }