aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/misc/srp6/srp6.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/misc/srp6/srp6.cpp')
-rw-r--r--src/lib/misc/srp6/srp6.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/lib/misc/srp6/srp6.cpp b/src/lib/misc/srp6/srp6.cpp
index 7fca6461f..f54726151 100644
--- a/src/lib/misc/srp6/srp6.cpp
+++ b/src/lib/misc/srp6/srp6.cpp
@@ -18,10 +18,7 @@ BigInt hash_seq(const std::string& hash_id,
const BigInt& in1,
const BigInt& in2)
{
- std::unique_ptr<HashFunction> hash_fn(HashFunction::create(hash_id));
-
- if(!hash_fn)
- throw Algorithm_Not_Found(hash_id);
+ std::unique_ptr<HashFunction> hash_fn(HashFunction::create_or_throw(hash_id));
hash_fn->update(BigInt::encode_1363(in1, pad_to));
hash_fn->update(BigInt::encode_1363(in2, pad_to));
@@ -34,10 +31,7 @@ BigInt compute_x(const std::string& hash_id,
const std::string& password,
const std::vector<byte>& salt)
{
- std::unique_ptr<HashFunction> hash_fn(HashFunction::create(hash_id));
-
- if(!hash_fn)
- throw Algorithm_Not_Found(hash_id);
+ std::unique_ptr<HashFunction> hash_fn(HashFunction::create_or_throw(hash_id));
hash_fn->update(identifier);
hash_fn->update(":");