diff options
author | lloyd <[email protected]> | 2015-02-01 23:46:07 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-02-01 23:46:07 +0000 |
commit | 69d2cd919c698a6b138b2ccba0de5d5aa2a33a03 (patch) | |
tree | 1386c3a1524717a21997804a76219093c3790218 /src/lib/math/numbertheory/dsa_gen.cpp | |
parent | fd3016d10124d2b7ccd7bc885235f2e407d73800 (diff) |
Add missing files. Remove cipher lookup from engine code.
Diffstat (limited to 'src/lib/math/numbertheory/dsa_gen.cpp')
-rw-r--r-- | src/lib/math/numbertheory/dsa_gen.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/math/numbertheory/dsa_gen.cpp b/src/lib/math/numbertheory/dsa_gen.cpp index 6524ad7d8..358b8bd6a 100644 --- a/src/lib/math/numbertheory/dsa_gen.cpp +++ b/src/lib/math/numbertheory/dsa_gen.cpp @@ -6,7 +6,7 @@ */ #include <botan/numthry.h> -#include <botan/algo_factory.h> +#include <botan/lookup.h> #include <botan/hash.h> #include <botan/parsing.h> #include <algorithm> @@ -38,7 +38,6 @@ bool fips186_3_valid_size(size_t pbits, size_t qbits) * Attempt DSA prime generation with given seed */ bool generate_dsa_primes(RandomNumberGenerator& rng, - Algorithm_Factory& af, BigInt& p, BigInt& q, size_t pbits, size_t qbits, const std::vector<byte>& seed_c) @@ -53,8 +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( - af.make_hash_function("SHA-" + std::to_string(qbits))); + std::unique_ptr<HashFunction> hash(get_hash("SHA-" + std::to_string(qbits))); const size_t HASH_SIZE = hash->output_length(); @@ -116,7 +114,6 @@ bool generate_dsa_primes(RandomNumberGenerator& rng, * Generate DSA Primes */ std::vector<byte> generate_dsa_primes(RandomNumberGenerator& rng, - Algorithm_Factory& af, BigInt& p, BigInt& q, size_t pbits, size_t qbits) { @@ -125,7 +122,7 @@ std::vector<byte> generate_dsa_primes(RandomNumberGenerator& rng, std::vector<byte> seed(qbits / 8); rng.randomize(&seed[0], seed.size()); - if(generate_dsa_primes(rng, af, p, q, pbits, qbits, seed)) + if(generate_dsa_primes(rng, p, q, pbits, qbits, seed)) return seed; } } |