8#include <botan/internal/keypair.h>
10#include <botan/pubkey.h>
21 std::string_view padding) {
33 std::vector<uint8_t> plaintext;
36 std::vector<uint8_t> ciphertext = encryptor.
encrypt(plaintext, rng);
37 if(ciphertext == plaintext) {
41 std::vector<uint8_t> decrypted =
unlock(decryptor.
decrypt(ciphertext));
43 return (plaintext == decrypted);
52 std::string_view padding) {
53 PK_Signer signer(private_key, rng, padding);
56 std::vector<uint8_t> message(32);
57 rng.
randomize(message.data(), message.size());
59 std::vector<uint8_t> signature;
secure_vector< uint8_t > decrypt(const uint8_t in[], size_t length) const
size_t maximum_input_size() const override
std::vector< uint8_t > encrypt(const uint8_t in[], size_t length, RandomNumberGenerator &rng) const
std::vector< uint8_t > sign_message(const uint8_t in[], size_t length, RandomNumberGenerator &rng)
bool verify_message(const uint8_t msg[], size_t msg_length, const uint8_t sig[], size_t sig_length)
void randomize(std::span< uint8_t > output)
void random_vec(std::span< uint8_t > v)
bool signature_consistency_check(RandomNumberGenerator &rng, const Private_Key &private_key, const Public_Key &public_key, std::string_view padding)
bool encryption_consistency_check(RandomNumberGenerator &rng, const Private_Key &private_key, const Public_Key &public_key, std::string_view padding)
std::vector< T > unlock(const secure_vector< T > &in)