46 static std::optional<EC_AffinePoint> deserialize(
const EC_Group& group, std::span<const uint8_t> bytes);
52 static std::optional<EC_AffinePoint> from_bigint_xy(
const EC_Group& group,
const BigInt& x,
const BigInt& y);
67 std::string_view hash_fn,
68 std::span<const uint8_t> input,
69 std::span<const uint8_t> domain_sep);
75 std::string_view hash_fn,
76 std::span<const uint8_t> input,
77 std::string_view domain_sep);
83 std::string_view hash_fn,
84 std::span<const uint8_t> input,
85 std::span<const uint8_t> domain_sep);
91 std::string_view hash_fn,
92 std::span<const uint8_t> input,
93 std::string_view domain_sep);
106 static std::optional<EC_AffinePoint> mul_px_qy(
const EC_AffinePoint& p,
129 size_t field_element_bytes()
const;
132 bool is_identity()
const;
139 void serialize_x_to(std::span<uint8_t> bytes)
const;
146 void serialize_y_to(std::span<uint8_t> bytes)
const;
153 void serialize_xy_to(std::span<uint8_t> bytes)
const;
160 void serialize_compressed_to(std::span<uint8_t> bytes)
const;
167 void serialize_uncompressed_to(std::span<uint8_t> bytes)
const;
172 template <concepts::resizable_
byte_buffer T = secure_vector<u
int8_t>>
174 T bytes(this->field_element_bytes());
175 this->serialize_x_to(bytes);
182 template <concepts::resizable_
byte_buffer T = secure_vector<u
int8_t>>
184 T bytes(this->field_element_bytes());
185 this->serialize_y_to(bytes);
192 template <concepts::resizable_
byte_buffer T = secure_vector<u
int8_t>>
194 T bytes(2 * this->field_element_bytes());
195 this->serialize_xy_to(bytes);
202 template <concepts::resizable_
byte_buffer T = std::vector<u
int8_t>>
204 T bytes(1 + 2 * this->field_element_bytes());
205 this->serialize_uncompressed_to(bytes);
212 template <concepts::resizable_
byte_buffer T = std::vector<u
int8_t>>
214 T bytes(1 + this->field_element_bytes());
215 this->serialize_compressed_to(bytes);
232#if defined(BOTAN_HAS_LEGACY_EC_POINT)
246 return EC_AffinePoint::g_mul(scalar, rng);
251 return this->mul(scalar, rng);
257 std::vector<BigInt>& )
const {
258 return this->mul_x_only(scalar, rng);
265 static EC_AffinePoint _from_inner(std::unique_ptr<EC_AffinePoint_Data> inner);
267 const std::shared_ptr<const EC_Group_Data>& _group()
const;
270 friend class EC_Mul2Table;
272 explicit EC_AffinePoint(std::unique_ptr<EC_AffinePoint_Data> point);
276 std::unique_ptr<EC_AffinePoint_Data> m_point;
secure_vector< uint8_t > mul_x_only(const EC_Scalar &scalar, RandomNumberGenerator &rng, std::vector< BigInt > &) const
Multiply a point by a scalar, returning the byte encoding of the x coordinate only.