diff options
Diffstat (limited to 'src/lib/misc/srp6/srp6.cpp')
-rw-r--r-- | src/lib/misc/srp6/srp6.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/misc/srp6/srp6.cpp b/src/lib/misc/srp6/srp6.cpp index d3f7338bd..f567db875 100644 --- a/src/lib/misc/srp6/srp6.cpp +++ b/src/lib/misc/srp6/srp6.cpp @@ -8,7 +8,6 @@ #include <botan/srp6.h> #include <botan/dl_group.h> #include <botan/numthry.h> -#include <botan/lookup.h> namespace Botan { @@ -19,7 +18,10 @@ BigInt hash_seq(const std::string& hash_id, const BigInt& in1, const BigInt& in2) { - std::unique_ptr<HashFunction> hash_fn(get_hash(hash_id)); + std::unique_ptr<HashFunction> hash_fn(HashFunction::create(hash_id)); + + if(!hash_fn) + throw Algorithm_Not_Found(hash_id); hash_fn->update(BigInt::encode_1363(in1, pad_to)); hash_fn->update(BigInt::encode_1363(in2, pad_to)); @@ -32,7 +34,10 @@ BigInt compute_x(const std::string& hash_id, const std::string& password, const std::vector<byte>& salt) { - std::unique_ptr<HashFunction> hash_fn(get_hash(hash_id)); + std::unique_ptr<HashFunction> hash_fn(HashFunction::create(hash_id)); + + if(!hash_fn) + throw Algorithm_Not_Found(hash_id); hash_fn->update(identifier); hash_fn->update(":"); |