61#if defined(BOTAN_HAS_AEAD_CHACHA20_POLY1305)
62 if(algo ==
"ChaCha20Poly1305") {
64 return std::make_unique<ChaCha20Poly1305_Encryption>();
66 return std::make_unique<ChaCha20Poly1305_Decryption>();
71#if defined(BOTAN_HAS_ASCON_AEAD128)
72 if(algo ==
"Ascon-AEAD128") {
74 return std::make_unique<Ascon_AEAD128_Encryption>();
76 return std::make_unique<Ascon_AEAD128_Decryption>();
81 if(algo.find(
'/') != std::string::npos) {
82 const std::vector<std::string> algo_parts =
split_on(algo,
'/');
83 const std::string_view cipher_name = algo_parts[0];
86 if(mode_info.empty()) {
87 return std::unique_ptr<AEAD_Mode>();
90 std::ostringstream mode_name;
92 mode_name << mode_info[0] <<
'(' << cipher_name;
93 for(
size_t i = 1; i < mode_info.size(); ++i) {
94 mode_name <<
',' << mode_info[i];
96 for(
size_t i = 2; i < algo_parts.size(); ++i) {
97 mode_name <<
',' << algo_parts[i];
104#if defined(BOTAN_HAS_BLOCK_CIPHER)
109 return std::unique_ptr<AEAD_Mode>();
115 return std::unique_ptr<AEAD_Mode>();
118 #if defined(BOTAN_HAS_AEAD_CCM)
123 return std::make_unique<CCM_Encryption>(std::move(bc), tag_len, L_len);
125 return std::make_unique<CCM_Decryption>(std::move(bc), tag_len, L_len);
130 #if defined(BOTAN_HAS_AEAD_GCM)
134 return std::make_unique<GCM_Encryption>(std::move(bc), tag_len);
136 return std::make_unique<GCM_Decryption>(std::move(bc), tag_len);
141 #if defined(BOTAN_HAS_AEAD_OCB)
145 return std::make_unique<OCB_Encryption>(std::move(bc), tag_len);
147 return std::make_unique<OCB_Decryption>(std::move(bc), tag_len);
152 #if defined(BOTAN_HAS_AEAD_EAX)
156 return std::make_unique<EAX_Encryption>(std::move(bc), tag_len);
158 return std::make_unique<EAX_Decryption>(std::move(bc), tag_len);
163 #if defined(BOTAN_HAS_AEAD_SIV)
166 return std::make_unique<SIV_Encryption>(std::move(bc));
168 return std::make_unique<SIV_Decryption>(std::move(bc));
175 return std::unique_ptr<AEAD_Mode>();