8#ifndef BOTAN_DL_PARAM_H_
9#define BOTAN_DL_PARAM_H_
11#include <botan/bigint.h>
15class Montgomery_Params;
35 enum PrimeType { Strong, Prime_Subgroup, DSA_Kosherizer };
45 DSA_PARAMETERS = ANSI_X9_57,
46 DH_PARAMETERS = ANSI_X9_42,
47 ANSI_X9_42_DH_PARAMETERS = ANSI_X9_42,
48 PKCS3_DH_PARAMETERS = PKCS_3
71 static DL_Group DL_Group_from_PEM(
const std::string& pem);
87 size_t pbits,
size_t qbits = 0);
97 const std::vector<uint8_t>& seed,
98 size_t pbits = 1024,
size_t qbits = 0);
123 template<
typename Alloc>
125 DL_Group(ber.data(), ber.size(), format) {}
131 const BigInt& get_p()
const;
137 const BigInt& get_q()
const;
143 const BigInt& get_g()
const;
159 bool verify_public_element(
const BigInt& y)
const;
166 bool verify_element_pair(
const BigInt& y,
const BigInt& x)
const;
180 std::vector<uint8_t> DER_encode(Format format)
const;
251 BigInt power_g_p(
const BigInt& x,
size_t max_x_bits)
const;
262 std::shared_ptr<const Montgomery_Params> monty_params_p()
const;
268 size_t p_bits()
const;
274 size_t p_bytes()
const;
281 size_t q_bits()
const;
288 size_t q_bytes()
const;
300 size_t exponent_bits()
const;
308 size_t estimated_strength()
const;
317 void BER_decode(
const std::vector<uint8_t>& ber, Format format);
323 void BOTAN_DEPRECATED(
"Use DL_Group_from_PEM") PEM_decode(const
std::
string& pem);
331 PEM_for_named_group(const
std::
string&
name);
336 static
std::shared_ptr<DL_Group_Data> DL_group_info(const
std::
string&
name);
339 static
std::shared_ptr<DL_Group_Data> load_DL_group_info(const
char* p_str,
343 static
std::shared_ptr<DL_Group_Data> load_DL_group_info(const
char* p_str,
346 static
std::shared_ptr<DL_Group_Data>
347 BER_decode_DL_group(const uint8_t data[],
size_t data_len,
351 const DL_Group_Data& data() const;
352 std::shared_ptr<DL_Group_Data> m_data;
DL_Group(const std::vector< uint8_t, Alloc > &ber, Format format)
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
std::string PEM_encode(const Private_Key &key)
PointGFp multi_exponentiate(const PointGFp &p1, const BigInt &z1, const PointGFp &p2, const BigInt &z2)