60#if defined(BOTAN_HAS_AEAD_CHACHA20_POLY1305)
61 if(algo ==
"ChaCha20Poly1305") {
63 return std::make_unique<ChaCha20Poly1305_Encryption>();
65 return std::make_unique<ChaCha20Poly1305_Decryption>();
70#if defined(BOTAN_HAS_ASCON_AEAD128)
71 if(algo ==
"Ascon-AEAD128") {
73 return std::make_unique<Ascon_AEAD128_Encryption>();
75 return std::make_unique<Ascon_AEAD128_Decryption>();
80 if(algo.find(
'/') != std::string::npos) {
81 const std::vector<std::string> algo_parts =
split_on(algo,
'/');
82 std::string_view cipher_name = algo_parts[0];
85 if(mode_info.empty()) {
86 return std::unique_ptr<AEAD_Mode>();
89 std::ostringstream mode_name;
91 mode_name << mode_info[0] <<
'(' << cipher_name;
92 for(
size_t i = 1; i < mode_info.size(); ++i) {
93 mode_name <<
',' << mode_info[i];
95 for(
size_t i = 2; i < algo_parts.size(); ++i) {
96 mode_name <<
',' << algo_parts[i];
103#if defined(BOTAN_HAS_BLOCK_CIPHER)
108 return std::unique_ptr<AEAD_Mode>();
114 return std::unique_ptr<AEAD_Mode>();
117 #if defined(BOTAN_HAS_AEAD_CCM)
122 return std::make_unique<CCM_Encryption>(std::move(bc), tag_len, L_len);
124 return std::make_unique<CCM_Decryption>(std::move(bc), tag_len, L_len);
129 #if defined(BOTAN_HAS_AEAD_GCM)
133 return std::make_unique<GCM_Encryption>(std::move(bc), tag_len);
135 return std::make_unique<GCM_Decryption>(std::move(bc), tag_len);
140 #if defined(BOTAN_HAS_AEAD_OCB)
144 return std::make_unique<OCB_Encryption>(std::move(bc), tag_len);
146 return std::make_unique<OCB_Decryption>(std::move(bc), tag_len);
151 #if defined(BOTAN_HAS_AEAD_EAX)
155 return std::make_unique<EAX_Encryption>(std::move(bc), tag_len);
157 return std::make_unique<EAX_Decryption>(std::move(bc), tag_len);
162 #if defined(BOTAN_HAS_AEAD_SIV)
165 return std::make_unique<SIV_Encryption>(std::move(bc));
167 return std::make_unique<SIV_Decryption>(std::move(bc));
174 return std::unique_ptr<AEAD_Mode>();