diff options
author | Jack Lloyd <[email protected]> | 2018-03-21 08:13:56 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-03-21 08:13:56 -0400 |
commit | 2821d60c9c159851c3d236fcc2bdeafd2d733849 (patch) | |
tree | ea1a382c8e93f49960b85d32799579fc68b0f385 /src/tests/test_rsa.cpp | |
parent | 9a35a05781688838b9bf951471c86363deba36cd (diff) | |
parent | 13e4658b07f95bef8b48d93c74be25f2d6afde7d (diff) |
Merge GH #1503 Support mixed hashes in OAEP
Diffstat (limited to 'src/tests/test_rsa.cpp')
-rw-r--r-- | src/tests/test_rsa.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/tests/test_rsa.cpp b/src/tests/test_rsa.cpp index 9dfde7e14..652d5cafd 100644 --- a/src/tests/test_rsa.cpp +++ b/src/tests/test_rsa.cpp @@ -39,6 +39,30 @@ class RSA_ES_KAT_Tests final : public PK_Encryption_Decryption_Test } }; +class RSA_Decryption_KAT_Tests final : public PK_Decryption_Test + { + public: + RSA_Decryption_KAT_Tests() : + PK_Decryption_Test("RSA", + "pubkey/rsa_decrypt.vec", + "E,P,Q,Ciphertext,Msg") {} + + bool clear_between_callbacks() const override + { + return false; + } + + std::unique_ptr<Botan::Private_Key> load_private_key(const VarMap& vars) override + { + const BigInt p = get_req_bn(vars, "P"); + const BigInt q = get_req_bn(vars, "Q"); + const BigInt e = get_req_bn(vars, "E"); + + std::unique_ptr<Botan::Private_Key> key(new Botan::RSA_PrivateKey(p, q, e)); + return key; + } + }; + class RSA_KEM_Tests final : public PK_KEM_Test { public: @@ -300,6 +324,7 @@ class RSA_Blinding_Tests final : public Test }; BOTAN_REGISTER_TEST("rsa_encrypt", RSA_ES_KAT_Tests); +BOTAN_REGISTER_TEST("rsa_decrypt", RSA_Decryption_KAT_Tests); BOTAN_REGISTER_TEST("rsa_sign", RSA_Signature_KAT_Tests); BOTAN_REGISTER_TEST("rsa_pss", RSA_PSS_KAT_Tests); BOTAN_REGISTER_TEST("rsa_pss_raw", RSA_PSS_Raw_KAT_Tests); |