diff options
author | lloyd <[email protected]> | 2012-07-27 17:30:13 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-07-27 17:30:13 +0000 |
commit | 4d0008edca9d3c0a119518e7d9b49c81d7dbe33c (patch) | |
tree | c359b14f9f0a0a495fea6eb241cb082fd0dc0717 /src/pubkey/dl_algo/dl_algo.cpp | |
parent | 16ccb3c130ad29aee2e640d498606314ac486f55 (diff) |
Add Public_Key::estimated_strength which gives an approximation of how
hard that key is to break.
Use it in cert path validation, rejecting keys with estimated strength
less than 80 bits.
Diffstat (limited to 'src/pubkey/dl_algo/dl_algo.cpp')
-rw-r--r-- | src/pubkey/dl_algo/dl_algo.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pubkey/dl_algo/dl_algo.cpp b/src/pubkey/dl_algo/dl_algo.cpp index c90e7651e..22c432108 100644 --- a/src/pubkey/dl_algo/dl_algo.cpp +++ b/src/pubkey/dl_algo/dl_algo.cpp @@ -7,11 +7,17 @@ #include <botan/dl_algo.h> #include <botan/numthry.h> +#include <botan/internal/workfactor.h> #include <botan/der_enc.h> #include <botan/ber_dec.h> namespace Botan { +size_t DL_Scheme_PublicKey::estimated_strength() const + { + return dl_work_factor(group.get_p().bits()); + } + AlgorithmIdentifier DL_Scheme_PublicKey::algorithm_identifier() const { return AlgorithmIdentifier(get_oid(), |