aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/numbertheory
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-02-01 23:46:07 +0000
committerlloyd <[email protected]>2015-02-01 23:46:07 +0000
commit69d2cd919c698a6b138b2ccba0de5d5aa2a33a03 (patch)
tree1386c3a1524717a21997804a76219093c3790218 /src/lib/math/numbertheory
parentfd3016d10124d2b7ccd7bc885235f2e407d73800 (diff)
Add missing files. Remove cipher lookup from engine code.
Diffstat (limited to 'src/lib/math/numbertheory')
-rw-r--r--src/lib/math/numbertheory/dsa_gen.cpp9
-rw-r--r--src/lib/math/numbertheory/numthry.h4
2 files changed, 3 insertions, 10 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;
}
}
diff --git a/src/lib/math/numbertheory/numthry.h b/src/lib/math/numbertheory/numthry.h
index b7a77d4da..5df0858ee 100644
--- a/src/lib/math/numbertheory/numthry.h
+++ b/src/lib/math/numbertheory/numthry.h
@@ -168,8 +168,6 @@ BigInt BOTAN_DLL random_prime(RandomNumberGenerator& rng,
BigInt BOTAN_DLL random_safe_prime(RandomNumberGenerator& rng,
size_t bits);
-class Algorithm_Factory;
-
/**
* Generate DSA parameters using the FIPS 186 kosherizer
* @param rng a random number generator
@@ -182,7 +180,6 @@ class Algorithm_Factory;
*/
std::vector<byte> BOTAN_DLL
generate_dsa_primes(RandomNumberGenerator& rng,
- Algorithm_Factory& af,
BigInt& p_out, BigInt& q_out,
size_t pbits, size_t qbits);
@@ -200,7 +197,6 @@ generate_dsa_primes(RandomNumberGenerator& rng,
*/
bool BOTAN_DLL
generate_dsa_primes(RandomNumberGenerator& rng,
- Algorithm_Factory& af,
BigInt& p_out, BigInt& q_out,
size_t pbits, size_t qbits,
const std::vector<byte>& seed);