10#ifndef BOTAN_ECC_DOMAIN_PARAMETERS_H_
11#define BOTAN_ECC_DOMAIN_PARAMETERS_H_
13#include <botan/point_gfp.h>
14#include <botan/asn1_obj.h>
41class EC_Group_Data_Map;
78 explicit EC_Group(
const uint8_t ber[],
size_t ber_len);
80 template<
typename Alloc>
81 EC_Group(
const std::vector<uint8_t, Alloc>& ber) :
98 explicit EC_Group(
const std::string& pem_or_oid);
100 static EC_Group EC_Group_from_PEM(
const std::string& pem);
131 bool a_is_minus_3()
const;
136 bool a_is_zero()
const;
141 size_t get_p_bits()
const;
146 size_t get_p_bytes()
const;
151 size_t get_order_bits()
const;
156 size_t get_order_bytes()
const;
161 const BigInt& get_p()
const;
166 const BigInt& get_a()
const;
171 const BigInt& get_b()
const;
177 const PointGFp& get_base_point()
const;
182 const BigInt& get_g_x()
const;
187 const BigInt& get_g_y()
const;
193 const BigInt& get_order()
const;
199 const BigInt& get_cofactor()
const;
231 return multiply_mod_order(x, square_mod_order(x));
240 bool verify_public_element(
const PointGFp& y)
const;
246 const OID& get_curve_oid()
const;
268 std::vector<BigInt>& ws)
const;
281 std::vector<BigInt>& ws)
const;
294 std::vector<BigInt>& ws)
const;
314 PointGFp hash_to_curve(
const std::string& hash_fn,
315 const uint8_t input[],
317 const uint8_t domain_sep[],
318 size_t domain_sep_len,
319 bool random_oracle =
true)
const;
333 PointGFp hash_to_curve(
const std::string& hash_fn,
334 const uint8_t input[],
336 const std::string& domain_sep,
337 bool random_oracle =
true)
const;
348 template<
typename Alloc>
351 return this->
OS2ECP(vec.data(), vec.size());
361 bool strong =
false)
const;
370 static const std::set<std::string>& known_named_groups();
375 static std::shared_ptr<EC_Group_Data> EC_group_info(
const OID& oid);
380 static size_t clear_registered_curve_data();
385 static OID EC_group_identity_from_order(
const BigInt& order);
388 static EC_Group_Data_Map& ec_group_data();
390 static std::shared_ptr<EC_Group_Data> BER_decode_EC_group(
const uint8_t bits[],
size_t len,
393 static std::shared_ptr<EC_Group_Data>
394 load_EC_group_info(
const char* p,
403 const EC_Group_Data& data()
const;
404 std::shared_ptr<EC_Group_Data> m_data;
410 return !(lhs == rhs);
EC_Group(const EC_Group &)=default
PointGFp OS2ECP(const std::vector< uint8_t, Alloc > &vec) const
BigInt cube_mod_order(const BigInt &x) const
EC_Group & operator=(EC_Group &&)=default
EC_Group(EC_Group &&)=default
EC_Group(const std::vector< uint8_t, Alloc > &ber)
EC_Group & operator=(const EC_Group &)=default
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
std::string PEM_encode(const Private_Key &key)
PointGFp OS2ECP(const uint8_t data[], size_t data_len, const CurveGFp &curve)
EC_Group EC_Domain_Params
bool operator!=(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
bool operator==(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
@ EC_DOMPAR_ENC_IMPLICITCA