aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-03-23 02:18:09 +0000
committerlloyd <[email protected]>2015-03-23 02:18:09 +0000
commitcd5ae5dae47241275477f63f1941bd233f861339 (patch)
tree16d9648e317458822725ef95f326fdf2d4ff6924 /src
parent2d5669770a5723d258703384f905e1d13d6b8696 (diff)
Cleanups
Diffstat (limited to 'src')
-rw-r--r--src/lib/math/numbertheory/dsa_gen.cpp2
-rw-r--r--src/lib/passhash/passhash9/passhash9.cpp25
2 files changed, 11 insertions, 16 deletions
diff --git a/src/lib/math/numbertheory/dsa_gen.cpp b/src/lib/math/numbertheory/dsa_gen.cpp
index 358b8bd6a..e28873550 100644
--- a/src/lib/math/numbertheory/dsa_gen.cpp
+++ b/src/lib/math/numbertheory/dsa_gen.cpp
@@ -52,7 +52,7 @@ bool generate_dsa_primes(RandomNumberGenerator& rng,
"Generating a DSA parameter set with a " + std::to_string(qbits) +
"long q requires a seed at least as many bits long");
- std::unique_ptr<HashFunction> hash(get_hash("SHA-" + std::to_string(qbits)));
+ std::unique_ptr<HashFunction> hash(make_hash_function("SHA-" + std::to_string(qbits)));
const size_t HASH_SIZE = hash->output_length();
diff --git a/src/lib/passhash/passhash9/passhash9.cpp b/src/lib/passhash/passhash9/passhash9.cpp
index f11a78dd0..3898cdb44 100644
--- a/src/lib/passhash/passhash9/passhash9.cpp
+++ b/src/lib/passhash/passhash9/passhash9.cpp
@@ -26,21 +26,16 @@ const size_t WORK_FACTOR_SCALE = 10000;
MessageAuthenticationCode* get_pbkdf_prf(byte alg_id)
{
- try
- {
- if(alg_id == 0)
- return get_mac("HMAC(SHA-1)");
- else if(alg_id == 1)
- return get_mac("HMAC(SHA-256)");
- else if(alg_id == 2)
- return get_mac("CMAC(Blowfish)");
- else if(alg_id == 3)
- return get_mac("HMAC(SHA-384)");
- else if(alg_id == 4)
- return get_mac("HMAC(SHA-512)");
- }
- catch(Algorithm_Not_Found) {}
-
+ if(alg_id == 0)
+ return get_mac("HMAC(SHA-1)");
+ else if(alg_id == 1)
+ return get_mac("HMAC(SHA-256)");
+ else if(alg_id == 2)
+ return get_mac("CMAC(Blowfish)");
+ else if(alg_id == 3)
+ return get_mac("HMAC(SHA-384)");
+ else if(alg_id == 4)
+ return get_mac("HMAC(SHA-512)");
return nullptr;
}