aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/mce
diff options
context:
space:
mode:
authorJack Lloyd <jack@randombit.net>2016-11-12 01:53:56 -0500
committerJack Lloyd <jack@randombit.net>2016-11-12 01:53:56 -0500
commit9c72dabc9dc73e2603c22dfce48611b5b626238b (patch)
treebda4f84f78bfbdd28e2199ee8f9998b08cc3c634 /src/lib/pubkey/mce
parent618f890fd7ede74c728612ca8bc590c72ee353f1 (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/mce')
-rw-r--r--src/lib/pubkey/mce/mceliece.h12
-rw-r--r--src/lib/pubkey/mce/mceliece_key.cpp5
2 files changed, 6 insertions, 11 deletions
diff --git a/src/lib/pubkey/mce/mceliece.h b/src/lib/pubkey/mce/mceliece.h
index c8b2606c5..c46be4a49 100644
--- a/src/lib/pubkey/mce/mceliece.h
+++ b/src/lib/pubkey/mce/mceliece.h
@@ -35,14 +35,9 @@ class BOTAN_DLL McEliece_PublicKey : public virtual Public_Key
std::string algo_name() const override { return "McEliece"; }
- /**
- * Get the maximum number of bits allowed to be fed to this key.
- * @result the maximum number of input bits
- */
- size_t max_input_bits() const override { return get_message_word_bit_length(); }
-
AlgorithmIdentifier algorithm_identifier() const override;
+ size_t key_length() const override;
size_t estimated_strength() const override;
std::vector<byte> x509_subject_public_key() const override;
@@ -75,11 +70,6 @@ class BOTAN_DLL McEliece_PrivateKey : public virtual McEliece_PublicKey,
public virtual Private_Key
{
public:
- /**
- * Get the maximum number of bits allowed to be fed to this key.
- * @result the maximum number of input bits
- */
- size_t max_input_bits() const override { return m_Linv.size(); }
/**
Generate a McEliece key pair
diff --git a/src/lib/pubkey/mce/mceliece_key.cpp b/src/lib/pubkey/mce/mceliece_key.cpp
index be34cd746..da92479ef 100644
--- a/src/lib/pubkey/mce/mceliece_key.cpp
+++ b/src/lib/pubkey/mce/mceliece_key.cpp
@@ -89,6 +89,11 @@ McEliece_PublicKey::McEliece_PublicKey(const McEliece_PublicKey & other) :
{
}
+size_t McEliece_PublicKey::key_length() const
+ {
+ return m_code_length;
+ }
+
size_t McEliece_PublicKey::estimated_strength() const
{
return mceliece_work_factor(m_code_length, m_t);