From add4bac81557ca3b36d395ced631c8b9a441ad16 Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 1 Oct 2008 02:39:30 +0000 Subject: Move generate_dsa_primes decl from DL_Group to numthry.h to match source location --- src/math/numbertheory/dsa_gen.cpp | 15 +++++++-------- src/math/numbertheory/numthry.h | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'src/math/numbertheory') 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 #include #include #include @@ -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& seed_c) +bool generate_dsa_primes(RandomNumberGenerator& rng, + BigInt& p, BigInt& q, + u32bit pbits, u32bit qbits, + const MemoryRegion& 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 DL_Group::generate_dsa_primes(RandomNumberGenerator& rng, - BigInt& p, BigInt& q, - u32bit pbits, u32bit qbits) +SecureVector generate_dsa_primes(RandomNumberGenerator& rng, + BigInt& p, BigInt& q, + u32bit pbits, u32bit qbits) { SecureVector 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 @@ -71,6 +71,20 @@ BigInt BOTAN_DLL random_prime(RandomNumberGenerator&, BigInt BOTAN_DLL random_safe_prime(RandomNumberGenerator&, u32bit); +/************************************************* +* DSA Parameter Generation * +*************************************************/ +SecureVector 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& seed); + /************************************************* * Prime Numbers * *************************************************/ -- cgit v1.2.3