10#include <botan/ecc_key.h>
12#include <botan/ber_dec.h>
13#include <botan/der_enc.h>
14#include <botan/ec_point.h>
15#include <botan/numthry.h>
16#include <botan/secmem.h>
17#include <botan/internal/ec_key_data.h>
18#include <botan/internal/fmt.h>
19#include <botan/internal/workfactor.h>
45 m_public_key = std::make_shared<const EC_PublicKey_Data>(std::move(group), std::move(pt));
50 m_public_key = std::make_shared<const EC_PublicKey_Data>(std::move(group), std::move(pub_point));
104 throw Invalid_Argument(
"Cannot used NamedCurve encoding for a curve without an OID");
126 bool with_modular_inverse) {
128 m_private_key = std::make_shared<EC_PrivateKey_Data>(std::move(ec_group), rng);
130 m_private_key = std::make_shared<EC_PrivateKey_Data>(std::move(ec_group), x);
138 m_private_key = std::make_shared<EC_PrivateKey_Data>(std::move(ec_group), rng);
144 m_private_key = std::make_shared<EC_PrivateKey_Data>(std::move(ec_group), std::move(x));
159 .
encode(
static_cast<size_t>(1))
169 std::span<const uint8_t> key_bits,
170 bool with_modular_inverse) {
205 if(field ==
"public_x" || field ==
"public_y") {
206 throw Not_Implemented(
fmt(
"EC_PublicKey::get_int_field no longer implements getter for {}", field));
207 }
else if(field ==
"base_x") {
209 }
else if(field ==
"base_y") {
211 }
else if(field ==
"p") {
213 }
else if(field ==
"a") {
215 }
else if(field ==
"b") {
217 }
else if(field ==
"cofactor") {
219 }
else if(field ==
"order") {
#define BOTAN_STATE_CHECK(expr)
const std::vector< uint8_t > & parameters() const
virtual const BigInt & get_int_field(std::string_view field) const
virtual OID object_identifier() const
BER_Decoder start_sequence()
BER_Decoder & decode_and_check(const T &expected, std::string_view error_msg)
secure_vector< uint8_t > get_contents()
DER_Encoder & start_explicit_context_specific(uint32_t tag)
DER_Encoder & start_sequence()
DER_Encoder & encode(bool b)
const BigInt & get_b() const
const BigInt & get_a() const
const BigInt & get_g_y() const
const BigInt & get_cofactor() const
bool verify_public_element(const EC_Point &y) const
const BigInt & get_p() const
bool verify_group(RandomNumberGenerator &rng, bool strong=false) const
const BigInt & get_order() const
size_t get_p_bits() const
const BigInt & get_g_x() const
const OID & get_curve_oid() const
std::vector< uint8_t > DER_encode(EC_Group_Encoding form) const
std::vector< uint8_t > encode(EC_Point_Format format) const
const EC_Scalar & _private_key() const
const BigInt & private_value() const
secure_vector< uint8_t > raw_private_key_bits() const final
std::shared_ptr< const EC_PrivateKey_Data > m_private_key
bool check_key(RandomNumberGenerator &rng, bool strong) const override
const BigInt & get_int_field(std::string_view field) const final
secure_vector< uint8_t > private_key_bits() const final
const EC_Group & domain() const
std::vector< uint8_t > DER_domain() const
void set_parameter_encoding(EC_Group_Encoding enc)
EC_Point_Format m_point_encoding
EC_Group_Encoding m_domain_encoding
const EC_AffinePoint & _public_key() const
size_t estimated_strength() const override
AlgorithmIdentifier algorithm_identifier() const override
size_t key_length() const override
EC_Group_Encoding domain_format() const
std::shared_ptr< const EC_PublicKey_Data > m_public_key
std::vector< uint8_t > raw_public_key_bits() const override
void set_point_encoding(EC_Point_Format enc)
const BigInt & get_int_field(std::string_view field) const override
EC_Point_Format point_encoding() const
bool check_key(RandomNumberGenerator &rng, bool strong) const override
const EC_Point & public_point() const
std::vector< uint8_t > public_key_bits() const override
size_t ecp_work_factor(size_t bits)
@ ExplicitContextSpecific
std::string fmt(std::string_view format, const T &... args)
std::vector< T, secure_allocator< T > > secure_vector