aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/test_rsa.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-03-21 08:13:56 -0400
committerJack Lloyd <[email protected]>2018-03-21 08:13:56 -0400
commit2821d60c9c159851c3d236fcc2bdeafd2d733849 (patch)
treeea1a382c8e93f49960b85d32799579fc68b0f385 /src/tests/test_rsa.cpp
parent9a35a05781688838b9bf951471c86363deba36cd (diff)
parent13e4658b07f95bef8b48d93c74be25f2d6afde7d (diff)
Merge GH #1503 Support mixed hashes in OAEP
Diffstat (limited to 'src/tests/test_rsa.cpp')
-rw-r--r--src/tests/test_rsa.cpp25
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);