aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/math/numbertheory/dsa_gen.cpp15
-rw-r--r--src/math/numbertheory/numthry.h14
-rw-r--r--src/pk/dl_group/dl_group.h10
3 files changed, 21 insertions, 18 deletions
diff --git a/src/math/numbertheory/dsa_gen.cpp b/src/math/numbertheory/dsa_gen.cpp
index baaba66ee..a9703e5bb 100644
--- a/src/math/numbertheory/dsa_gen.cpp
+++ b/src/math/numbertheory/dsa_gen.cpp
@@ -3,7 +3,6 @@
* (C) 1999-2007 Jack Lloyd *
*************************************************/
-#include <botan/dl_group.h>
#include <botan/numthry.h>
#include <botan/lookup.h>
#include <botan/parsing.h>
@@ -36,10 +35,10 @@ bool fips186_3_valid_size(u32bit pbits, u32bit qbits)
/*************************************************
* Attempt DSA prime generation with given seed *
*************************************************/
-bool DL_Group::generate_dsa_primes(RandomNumberGenerator& rng,
- BigInt& p, BigInt& q,
- u32bit pbits, u32bit qbits,
- const MemoryRegion<byte>& seed_c)
+bool generate_dsa_primes(RandomNumberGenerator& rng,
+ BigInt& p, BigInt& q,
+ u32bit pbits, u32bit qbits,
+ const MemoryRegion<byte>& seed_c)
{
if(!fips186_3_valid_size(pbits, qbits))
throw Invalid_Argument(
@@ -116,9 +115,9 @@ bool DL_Group::generate_dsa_primes(RandomNumberGenerator& rng,
/*************************************************
* Generate DSA Primes *
*************************************************/
-SecureVector<byte> DL_Group::generate_dsa_primes(RandomNumberGenerator& rng,
- BigInt& p, BigInt& q,
- u32bit pbits, u32bit qbits)
+SecureVector<byte> generate_dsa_primes(RandomNumberGenerator& rng,
+ BigInt& p, BigInt& q,
+ u32bit pbits, u32bit qbits)
{
SecureVector<byte> seed(qbits/8);
diff --git a/src/math/numbertheory/numthry.h b/src/math/numbertheory/numthry.h
index a271a428a..19726646a 100644
--- a/src/math/numbertheory/numthry.h
+++ b/src/math/numbertheory/numthry.h
@@ -72,6 +72,20 @@ BigInt BOTAN_DLL random_safe_prime(RandomNumberGenerator&,
u32bit);
/*************************************************
+* DSA Parameter Generation *
+*************************************************/
+SecureVector<byte> BOTAN_DLL
+generate_dsa_primes(RandomNumberGenerator& rng,
+ BigInt& p, BigInt& q,
+ u32bit pbits, u32bit qbits);
+
+bool BOTAN_DLL
+generate_dsa_primes(RandomNumberGenerator& rng,
+ BigInt& p_out, BigInt& q_out,
+ u32bit p_bits, u32bit q_bits,
+ const MemoryRegion<byte>& seed);
+
+/*************************************************
* Prime Numbers *
*************************************************/
const u32bit PRIME_TABLE_SIZE = 6541;
diff --git a/src/pk/dl_group/dl_group.h b/src/pk/dl_group/dl_group.h
index 5d4f46e2d..7d631433e 100644
--- a/src/pk/dl_group/dl_group.h
+++ b/src/pk/dl_group/dl_group.h
@@ -17,16 +17,6 @@ namespace Botan {
class BOTAN_DLL DL_Group
{
public:
- static SecureVector<byte>
- generate_dsa_primes(RandomNumberGenerator& rng,
- BigInt& p, BigInt& q,
- u32bit pbits, u32bit qbits);
-
- static bool generate_dsa_primes(RandomNumberGenerator& rng,
- BigInt& p_out, BigInt& q_out,
- u32bit p_bits, u32bit q_bits,
- const MemoryRegion<byte>& seed);
-
const BigInt& get_p() const;
const BigInt& get_q() const;
const BigInt& get_g() const;