8#ifndef BOTAN_SM2_KEY_H_
9#define BOTAN_SM2_KEY_H_
11#include <botan/ecc_key.h>
27#if defined(BOTAN_HAS_LEGACY_EC_POINT)
48 std::string algo_name()
const override;
57 return domain().get_order_bytes();
60 std::unique_ptr<PK_Ops::Verification> create_verification_op(std::string_view params,
61 std::string_view provider)
const override;
64 std::string_view params,
65 std::string_view provider)
const override;
113 std::unique_ptr<Public_Key>
public_key()
const override;
116 std::string_view params,
117 std::string_view provider)
const override;
120 std::string_view params,
121 std::string_view provider)
const override;
143 sm2_compute_za(HashFunction& hash, std::string_view user_id, const EC_Group& group, const EC_AffinePoint& pubkey);
145#if defined(BOTAN_HAS_LEGACY_EC_POINT)
153 std::string_view user_id,
154 const EC_Group& group,
155 const EC_Point& pubkey) {
156 auto apoint = EC_AffinePoint(group, pubkey);
#define BOTAN_DIAGNOSTIC_POP
#define BOTAN_DIAGNOSTIC_PUSH
#define BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
#define BOTAN_PUBLIC_API(maj, min)
#define BOTAN_DEPRECATED(msg)
EC_PrivateKey(const EC_PrivateKey &other)=default
const EC_Group & domain() const
EC_PublicKey(const EC_PublicKey &other)=default
std::unique_ptr< Public_Key > public_key() const override
std::unique_ptr< PK_Ops::Signature > create_signature_op(RandomNumberGenerator &rng, std::string_view params, std::string_view provider) const override
bool check_key(RandomNumberGenerator &rng, bool) const override
SM2_PrivateKey(const AlgorithmIdentifier &alg_id, std::span< const uint8_t > key_bits)
const BigInt & get_da_inv() const
const EC_Scalar & _get_da_inv() const
std::unique_ptr< PK_Ops::Decryption > create_decryption_op(RandomNumberGenerator &rng, std::string_view params, std::string_view provider) const override
bool supports_operation(PublicKeyOperation op) const override
SM2_PublicKey(const EC_Group &group, const EC_AffinePoint &public_key)
std::optional< size_t > _signature_element_size_for_DER_encoding() const override
SM2_PublicKey(const AlgorithmIdentifier &alg_id, std::span< const uint8_t > key_bits)
SM2_PublicKey SM2_Encryption_PublicKey
SM2_PrivateKey SM2_Signature_PrivateKey
SM2_PublicKey SM2_Signature_PublicKey
SM2_PrivateKey SM2_Encryption_PrivateKey
std::vector< uint8_t > sm2_compute_za(HashFunction &hash, std::string_view user_id, const EC_Group &group, const EC_AffinePoint &pubkey)