aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/misc/srp6/srp6.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-09-21 14:59:01 -0400
committerJack Lloyd <[email protected]>2015-09-21 14:59:01 -0400
commit04319af23bf8ed467b17f9b74c814343e051ab6b (patch)
tree630d1a0cc931e77e7e1f07319e5cf89d00af4458 /src/lib/misc/srp6/srp6.cpp
parent408ea0a9b8ed0f575f8ee26891473920b42ef026 (diff)
Remove use of lookup.h in favor of new T::create API.
Diffstat (limited to 'src/lib/misc/srp6/srp6.cpp')
-rw-r--r--src/lib/misc/srp6/srp6.cpp11
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(":");