8#include <botan/internal/eme.h>
10#include <botan/exceptn.h>
11#include <botan/internal/parsing.h>
12#include <botan/internal/scan_name.h>
14#if defined(BOTAN_HAS_EME_OAEP)
15 #include <botan/internal/oaep.h>
18#if defined(BOTAN_HAS_EME_PKCS1)
19 #include <botan/internal/eme_pkcs.h>
22#if defined(BOTAN_HAS_EME_RAW)
23 #include <botan/internal/eme_raw.h>
29#if defined(BOTAN_HAS_EME_RAW)
30 if(algo_spec ==
"Raw") {
31 return std::make_unique<EME_Raw>();
35#if defined(BOTAN_HAS_EME_PKCS1)
36 if(algo_spec ==
"PKCS1v15" || algo_spec ==
"EME-PKCS1-v1_5") {
37 return std::make_unique<EME_PKCS1v15>();
41#if defined(BOTAN_HAS_EME_OAEP)
47 return std::make_unique<OAEP>(std::move(hash), req.
arg(2,
""));
52 if(mgf_params.size() == 2 && mgf_params[0] ==
"MGF1") {
56 if(hash && mgf1_hash) {
57 return std::make_unique<OAEP>(std::move(hash), std::move(mgf1_hash), req.
arg(2,
""));
74 return pad(msg, msg_len, key_bits, rng);
83 return pad(msg.data(), msg.size(), key_bits, rng);
secure_vector< uint8_t > encode(const uint8_t in[], size_t in_length, size_t key_length, RandomNumberGenerator &rng) const
virtual secure_vector< uint8_t > pad(const uint8_t in[], size_t in_length, size_t key_length, RandomNumberGenerator &rng) const =0
static std::unique_ptr< EME > create(std::string_view algo_spec)
static std::unique_ptr< HashFunction > create(std::string_view algo_spec, std::string_view provider="")
std::string arg(size_t i) const
const std::string & algo_name() const
std::vector< std::string > parse_algorithm_name(std::string_view namex)
std::vector< T, secure_allocator< T > > secure_vector