8 #ifndef BOTAN_DL_PARAM_H_
9 #define BOTAN_DL_PARAM_H_
11 #include <botan/bigint.h>
15 class Montgomery_Params;
39 DSA_PARAMETERS = ANSI_X9_57,
40 DH_PARAMETERS = ANSI_X9_42,
41 ANSI_X9_42_DH_PARAMETERS = ANSI_X9_42,
42 PKCS3_DH_PARAMETERS = PKCS_3
75 size_t pbits,
size_t qbits = 0);
85 const std::vector<uint8_t>& seed,
86 size_t pbits = 1024,
size_t qbits = 0);
106 DL_Group(
const uint8_t ber[],
size_t ber_len, Format format);
111 template<
typename Alloc>
113 DL_Group(ber.data(), ber.size(), format) {}
119 const BigInt& get_p()
const;
125 const BigInt& get_q()
const;
131 const BigInt& get_g()
const;
147 bool verify_public_element(
const BigInt& y)
const;
154 bool verify_element_pair(
const BigInt& y,
const BigInt& x)
const;
168 std::vector<uint8_t> DER_encode(Format format)
const;
239 BigInt power_g_p(
const BigInt& x,
size_t max_x_bits)
const;
250 std::shared_ptr<const Montgomery_Params> monty_params_p()
const;
256 size_t p_bits()
const;
262 size_t p_bytes()
const;
269 size_t q_bits()
const;
276 size_t q_bytes()
const;
288 size_t exponent_bits()
const;
296 size_t estimated_strength()
const;
303 void BER_decode(
const std::vector<uint8_t>& ber, Format format);
309 void PEM_decode(
const std::string& pem);
314 static std::string BOTAN_DEPRECATED(
"Use DL_Group(name).PEM_encode()")
315 PEM_for_named_group(const
std::
string&
name);
320 static
std::shared_ptr<DL_Group_Data> DL_group_info(const
std::
string& name);
323 static
std::shared_ptr<DL_Group_Data> load_DL_group_info(const
char* p_str,
327 static
std::shared_ptr<DL_Group_Data> load_DL_group_info(const
char* p_str,
330 static
std::shared_ptr<DL_Group_Data>
331 BER_decode_DL_group(const uint8_t data[],
size_t data_len,
DL_Group::Format format);
333 const DL_Group_Data& data() const;
334 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)