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/pk_ops_impl.h | |
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/pk_ops_impl.h')
-rw-r--r-- | src/lib/pubkey/pk_ops_impl.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/pubkey/pk_ops_impl.h b/src/lib/pubkey/pk_ops_impl.h index 5fe5623e7..bde119ab4 100644 --- a/src/lib/pubkey/pk_ops_impl.h +++ b/src/lib/pubkey/pk_ops_impl.h @@ -1,3 +1,4 @@ + /* * (C) 2015 Jack Lloyd * @@ -35,8 +36,6 @@ class Encryption_with_EME : public Encryption class Decryption_with_EME : public Decryption { public: - size_t max_input_bits() const override; - secure_vector<byte> decrypt(byte& valid_mask, const byte msg[], size_t msg_len) override; @@ -52,6 +51,8 @@ class Decryption_with_EME : public Decryption class Verification_with_EMSA : public Verification { public: + ~Verification_with_EMSA(); + void update(const byte msg[], size_t msg_len) override; bool is_valid_signature(const byte sig[], size_t sig_len) override; @@ -59,10 +60,15 @@ class Verification_with_EMSA : public Verification const byte sig[], size_t sig_len); std::string hash_for_signature() { return m_hash; } - protected: + protected: explicit Verification_with_EMSA(const std::string& emsa); - ~Verification_with_EMSA(); + + /** + * Get the maximum message size in bits supported by this public key. + * @return maximum message in bits + */ + virtual size_t max_input_bits() const = 0; /** * @return boolean specifying if this signature scheme uses |