diff options
author | Jack Lloyd <[email protected]> | 2016-11-12 01:53:56 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-11-12 01:53:56 -0500 |
commit | 9c72dabc9dc73e2603c22dfce48611b5b626238b (patch) | |
tree | bda4f84f78bfbdd28e2199ee8f9998b08cc3c634 /src/lib/pubkey/rsa | |
parent | 618f890fd7ede74c728612ca8bc590c72ee353f1 (diff) |
Pubkey cleanups
Add Public_Key::key_length usable for policy checking (as in
TLS::Policy::check_peer_key_acceptable)
Remove Public_Key::max_input_bits because it didn't make much sense
for most algorithms actually.
Remove message_parts and message_part_size from PK_Ops
Diffstat (limited to 'src/lib/pubkey/rsa')
-rw-r--r-- | src/lib/pubkey/rsa/rsa.cpp | 7 | ||||
-rw-r--r-- | src/lib/pubkey/rsa/rsa.h | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/pubkey/rsa/rsa.cpp b/src/lib/pubkey/rsa/rsa.cpp index eae95fe02..4302aa88a 100644 --- a/src/lib/pubkey/rsa/rsa.cpp +++ b/src/lib/pubkey/rsa/rsa.cpp @@ -25,9 +25,14 @@ namespace Botan { +size_t RSA_PublicKey::key_length() const + { + return m_n.bits(); + } + size_t RSA_PublicKey::estimated_strength() const { - return if_work_factor(m_n.bits()); + return if_work_factor(key_length()); } AlgorithmIdentifier RSA_PublicKey::algorithm_identifier() const diff --git a/src/lib/pubkey/rsa/rsa.h b/src/lib/pubkey/rsa/rsa.h index 98d9217b8..f576a5f07 100644 --- a/src/lib/pubkey/rsa/rsa.h +++ b/src/lib/pubkey/rsa/rsa.h @@ -53,8 +53,7 @@ class BOTAN_DLL RSA_PublicKey : public virtual Public_Key */ const BigInt& get_e() const { return m_e; } - size_t max_input_bits() const override { return (m_n.bits() - 1); } - + size_t key_length() const override; size_t estimated_strength() const override; std::unique_ptr<PK_Ops::Encryption> |