8#ifndef BOTAN_PK_OPERATION_IMPL_H_
9#define BOTAN_PK_OPERATION_IMPL_H_
11#include <botan/hash.h>
13#include <botan/pk_ops.h>
14#include <botan/internal/eme.h>
30 virtual size_t max_ptext_input_bits()
const = 0;
33 std::unique_ptr<EME> m_eme;
47 std::unique_ptr<EME> m_eme;
54 void update(
const uint8_t msg[],
size_t msg_len)
override;
63 std::string_view pk_algo,
64 bool allow_null_parameters =
false);
74 virtual bool verify(
const uint8_t msg[],
size_t msg_len,
const uint8_t sig[],
size_t sig_len) = 0;
77 std::unique_ptr<HashFunction> m_hash;
82 void update(
const uint8_t msg[],
size_t msg_len)
override;
93#if defined(BOTAN_HAS_RFC6979_GENERATOR)
94 std::string rfc6979_hash_function()
const;
100 std::unique_ptr<HashFunction> m_hash;
106 const uint8_t other_key[],
107 size_t other_key_len,
108 const uint8_t salt[],
109 size_t salt_len)
override;
118 std::unique_ptr<KDF> m_kdf;
123 void kem_encrypt(std::span<uint8_t> out_encapsulated_key,
124 std::span<uint8_t> out_shared_key,
126 size_t desired_shared_key_len,
127 std::span<const uint8_t> salt)
final;
135 std::span<uint8_t> out_raw_shared_key,
143 std::unique_ptr<KDF> m_kdf;
148 void kem_decrypt(std::span<uint8_t> out_shared_key,
149 std::span<const uint8_t> encapsulated_key,
150 size_t desired_shared_key_len,
151 std::span<const uint8_t> salt)
final;
159 std::span<const uint8_t> encapsulated_key) = 0;
166 std::unique_ptr<KDF> m_kdf;
secure_vector< uint8_t > decrypt(uint8_t &valid_mask, const uint8_t msg[], size_t msg_len) override
~Decryption_with_EME() override=default
Decryption_with_EME(std::string_view eme)
size_t max_input_bits() const override
secure_vector< uint8_t > encrypt(const uint8_t msg[], size_t msg_len, RandomNumberGenerator &rng) override
~Encryption_with_EME() override=default
Encryption_with_EME(std::string_view eme)
void kem_decrypt(std::span< uint8_t > out_shared_key, std::span< const uint8_t > encapsulated_key, size_t desired_shared_key_len, std::span< const uint8_t > salt) final
~KEM_Decryption_with_KDF() override=default
KEM_Decryption_with_KDF(std::string_view kdf)
virtual void raw_kem_decrypt(std::span< uint8_t > out_raw_shared_key, std::span< const uint8_t > encapsulated_key)=0
size_t shared_key_length(size_t desired_shared_key_len) const final
virtual size_t raw_kem_shared_key_length() const =0
void kem_encrypt(std::span< uint8_t > out_encapsulated_key, std::span< uint8_t > out_shared_key, RandomNumberGenerator &rng, size_t desired_shared_key_len, std::span< const uint8_t > salt) final
virtual size_t raw_kem_shared_key_length() const =0
size_t shared_key_length(size_t desired_shared_key_len) const final
~KEM_Encryption_with_KDF() override=default
virtual void raw_kem_encrypt(std::span< uint8_t > out_encapsulated_key, std::span< uint8_t > out_raw_shared_key, RandomNumberGenerator &rng)=0
KEM_Encryption_with_KDF(std::string_view kdf)
Key_Agreement_with_KDF(std::string_view kdf)
~Key_Agreement_with_KDF() override=default
secure_vector< uint8_t > agree(size_t key_len, const uint8_t other_key[], size_t other_key_len, const uint8_t salt[], size_t salt_len) override
~Signature_with_Hash() override=default
std::string hash_function() const final
secure_vector< uint8_t > sign(RandomNumberGenerator &rng) override
Signature_with_Hash(std::string_view hash)
~Verification_with_Hash() override=default
virtual bool verify(const uint8_t msg[], size_t msg_len, const uint8_t sig[], size_t sig_len)=0
std::string hash_function() const final
Verification_with_Hash(std::string_view hash)
bool is_valid_signature(const uint8_t sig[], size_t sig_len) override
int(* update)(CTX *, const void *, CC_LONG len)
int(* final)(unsigned char *, CTX *)
std::vector< T, secure_allocator< T > > secure_vector