From 8a6a6091838dd76edaa29137e26340a760a895c9 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Mon, 19 Feb 2018 16:07:04 -0500 Subject: Remove PK_Ops::Decryption_with_EME::max_raw_input_bits Unused and not exposed to higher levels. RSA and ElGamal both check their inputs vs the system parameters (n, p) after decoding. --- src/lib/pubkey/elgamal/elgamal.cpp | 2 -- src/lib/pubkey/pk_ops_impl.h | 1 - src/lib/pubkey/rsa/rsa.cpp | 2 -- 3 files changed, 5 deletions(-) (limited to 'src/lib/pubkey') diff --git a/src/lib/pubkey/elgamal/elgamal.cpp b/src/lib/pubkey/elgamal/elgamal.cpp index 3a5d8b81e..e03fd0bb6 100644 --- a/src/lib/pubkey/elgamal/elgamal.cpp +++ b/src/lib/pubkey/elgamal/elgamal.cpp @@ -117,8 +117,6 @@ class ElGamal_Decryption_Operation final : public PK_Ops::Decryption_with_EME { public: - size_t max_raw_input_bits() const override { return m_group.p_bits() - 1; } - ElGamal_Decryption_Operation(const ElGamal_PrivateKey& key, const std::string& eme, RandomNumberGenerator& rng); diff --git a/src/lib/pubkey/pk_ops_impl.h b/src/lib/pubkey/pk_ops_impl.h index 1576911fb..1878a7417 100644 --- a/src/lib/pubkey/pk_ops_impl.h +++ b/src/lib/pubkey/pk_ops_impl.h @@ -46,7 +46,6 @@ class Decryption_with_EME : public Decryption protected: explicit Decryption_with_EME(const std::string& eme); private: - virtual size_t max_raw_input_bits() const = 0; virtual secure_vector raw_decrypt(const uint8_t msg[], size_t len) = 0; std::unique_ptr m_eme; }; diff --git a/src/lib/pubkey/rsa/rsa.cpp b/src/lib/pubkey/rsa/rsa.cpp index 1ba4d6b25..e1c3e49db 100644 --- a/src/lib/pubkey/rsa/rsa.cpp +++ b/src/lib/pubkey/rsa/rsa.cpp @@ -269,8 +269,6 @@ class RSA_Decryption_Operation final : public PK_Ops::Decryption_with_EME, { public: - size_t max_raw_input_bits() const override { return get_max_input_bits(); } - RSA_Decryption_Operation(const RSA_PrivateKey& rsa, const std::string& eme, RandomNumberGenerator& rng) : PK_Ops::Decryption_with_EME(eme), RSA_Private_Operation(rsa, rng) -- cgit v1.2.3