diff options
-rw-r--r-- | src/lib/math/numbertheory/dsa_gen.cpp | 2 | ||||
-rw-r--r-- | src/lib/passhash/passhash9/passhash9.cpp | 25 |
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; } |