aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/numbertheory
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/math/numbertheory
parent408ea0a9b8ed0f575f8ee26891473920b42ef026 (diff)
Remove use of lookup.h in favor of new T::create API.
Diffstat (limited to 'src/lib/math/numbertheory')
-rw-r--r--src/lib/math/numbertheory/dsa_gen.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/math/numbertheory/dsa_gen.cpp b/src/lib/math/numbertheory/dsa_gen.cpp
index bd3c0e4a1..60151355a 100644
--- a/src/lib/math/numbertheory/dsa_gen.cpp
+++ b/src/lib/math/numbertheory/dsa_gen.cpp
@@ -6,7 +6,6 @@
*/
#include <botan/numthry.h>
-#include <botan/lookup.h>
#include <botan/hash.h>
#include <botan/parsing.h>
#include <algorithm>
@@ -52,7 +51,10 @@ 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(make_hash_function("SHA-" + std::to_string(qbits)));
+ const std::string hash_name = "SHA-" + std::to_string(qbits);
+ std::unique_ptr<HashFunction> hash(HashFunction::create(hash_name));
+ if(!hash)
+ throw Algorithm_Not_Found(hash_name);
const size_t HASH_SIZE = hash->output_length();