7 #include <botan/aead.h>
8 #include <botan/scan_name.h>
11 #if defined(BOTAN_HAS_BLOCK_CIPHER)
12 #include <botan/block_cipher.h>
15 #if defined(BOTAN_HAS_AEAD_CCM)
16 #include <botan/ccm.h>
19 #if defined(BOTAN_HAS_AEAD_CHACHA20_POLY1305)
20 #include <botan/chacha20poly1305.h>
23 #if defined(BOTAN_HAS_AEAD_EAX)
24 #include <botan/eax.h>
27 #if defined(BOTAN_HAS_AEAD_GCM)
28 #include <botan/gcm.h>
31 #if defined(BOTAN_HAS_AEAD_OCB)
32 #include <botan/ocb.h>
35 #if defined(BOTAN_HAS_AEAD_SIV)
36 #include <botan/siv.h>
43 #if defined(BOTAN_HAS_AEAD_CHACHA20_POLY1305)
44 if(algo ==
"ChaCha20Poly1305")
54 if(algo.find(
'/') != std::string::npos)
56 const std::vector<std::string> algo_parts =
split_on(algo,
'/');
57 const std::string cipher_name = algo_parts[0];
63 std::ostringstream alg_args;
65 alg_args <<
'(' << cipher_name;
66 for(
size_t i = 1; i < mode_info.size(); ++i)
67 alg_args <<
',' << mode_info[i];
68 for(
size_t i = 2; i < algo_parts.size(); ++i)
69 alg_args <<
',' << algo_parts[i];
72 const std::string mode_name = mode_info[0] + alg_args.str();
76 #if defined(BOTAN_HAS_BLOCK_CIPHER)
92 #if defined(BOTAN_HAS_AEAD_CCM)
104 #if defined(BOTAN_HAS_AEAD_GCM)
115 #if defined(BOTAN_HAS_AEAD_OCB)
126 #if defined(BOTAN_HAS_AEAD_EAX)
137 #if defined(BOTAN_HAS_AEAD_SIV)
std::vector< std::string > parse_algorithm_name(const std::string &namex)
std::string arg(size_t i) const
std::vector< std::string > split_on(const std::string &str, char delim)
size_t arg_as_integer(size_t i, size_t def_value) const
AEAD_Mode * get_aead(const std::string &algo, Cipher_Dir dir)
static std::unique_ptr< BlockCipher > create(const std::string &algo_spec, const std::string &provider="")
const std::string & algo_name() const