diff options
author | lloyd <[email protected]> | 2014-11-29 14:16:26 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-11-29 14:16:26 +0000 |
commit | e89b6a365e56283a945aeda8ed2b427937fe5d91 (patch) | |
tree | e01cd34049831debff697de3f11fb54d175a8b81 /src/lib/pubkey/mce | |
parent | 71ff50357af5183995c9af59f1816f065ce9a857 (diff) |
Move all PK workfactor esstimators to workfactors.*
Diffstat (limited to 'src/lib/pubkey/mce')
-rw-r--r-- | src/lib/pubkey/mce/mceliece_key.cpp | 9 | ||||
-rw-r--r-- | src/lib/pubkey/mce/mceliece_key.h | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/pubkey/mce/mceliece_key.cpp b/src/lib/pubkey/mce/mceliece_key.cpp index 71e0ec4e8..7da5aefed 100644 --- a/src/lib/pubkey/mce/mceliece_key.cpp +++ b/src/lib/pubkey/mce/mceliece_key.cpp @@ -14,10 +14,10 @@ #include <botan/gf2m_small_m.h> #include <botan/mceliece.h> #include <botan/internal/code_based_key_gen.h> -#include <botan/alg_id.h> +#include <botan/code_based_util.h> #include <botan/der_enc.h> #include <botan/ber_dec.h> -#include <botan/oids.h> +#include <botan/workfactor.h> namespace Botan { @@ -74,6 +74,11 @@ McEliece_PublicKey::McEliece_PublicKey(const McEliece_PublicKey & other) : { } +size_t McEliece_PublicKey::estimated_strength() const + { + return mceliece_work_factor(m_t, m_code_length); + } + McEliece_PublicKey::McEliece_PublicKey(const std::vector<byte>& key_bits) { BER_Decoder dec(key_bits); diff --git a/src/lib/pubkey/mce/mceliece_key.h b/src/lib/pubkey/mce/mceliece_key.h index c51745bba..1a9a699f4 100644 --- a/src/lib/pubkey/mce/mceliece_key.h +++ b/src/lib/pubkey/mce/mceliece_key.h @@ -15,7 +15,6 @@ #include <botan/exceptn.h> #include <botan/pk_keys.h> #include <botan/polyn_gf2m.h> -#include <botan/code_based_util.h> namespace Botan { @@ -47,7 +46,7 @@ class BOTAN_DLL McEliece_PublicKey : public virtual Public_Key AlgorithmIdentifier algorithm_identifier() const; - size_t estimated_strength() const { return 0; } + size_t estimated_strength() const; std::vector<byte> x509_subject_public_key() const; |