55#if defined(BOTAN_HAS_AEAD_CHACHA20_POLY1305)
56 if(algo ==
"ChaCha20Poly1305") {
58 return std::make_unique<ChaCha20Poly1305_Encryption>();
60 return std::make_unique<ChaCha20Poly1305_Decryption>();
65 if(algo.find(
'/') != std::string::npos) {
66 const std::vector<std::string> algo_parts =
split_on(algo,
'/');
67 std::string_view cipher_name = algo_parts[0];
70 if(mode_info.empty()) {
71 return std::unique_ptr<AEAD_Mode>();
74 std::ostringstream mode_name;
76 mode_name << mode_info[0] <<
'(' << cipher_name;
77 for(
size_t i = 1; i < mode_info.size(); ++i) {
78 mode_name <<
',' << mode_info[i];
80 for(
size_t i = 2; i < algo_parts.size(); ++i) {
81 mode_name <<
',' << algo_parts[i];
88#if defined(BOTAN_HAS_BLOCK_CIPHER)
93 return std::unique_ptr<AEAD_Mode>();
99 return std::unique_ptr<AEAD_Mode>();
102 #if defined(BOTAN_HAS_AEAD_CCM)
107 return std::make_unique<CCM_Encryption>(std::move(bc), tag_len, L_len);
109 return std::make_unique<CCM_Decryption>(std::move(bc), tag_len, L_len);
114 #if defined(BOTAN_HAS_AEAD_GCM)
118 return std::make_unique<GCM_Encryption>(std::move(bc), tag_len);
120 return std::make_unique<GCM_Decryption>(std::move(bc), tag_len);
125 #if defined(BOTAN_HAS_AEAD_OCB)
129 return std::make_unique<OCB_Encryption>(std::move(bc), tag_len);
131 return std::make_unique<OCB_Decryption>(std::move(bc), tag_len);
136 #if defined(BOTAN_HAS_AEAD_EAX)
140 return std::make_unique<EAX_Encryption>(std::move(bc), tag_len);
142 return std::make_unique<EAX_Decryption>(std::move(bc), tag_len);
147 #if defined(BOTAN_HAS_AEAD_SIV)
150 return std::make_unique<SIV_Encryption>(std::move(bc));
152 return std::make_unique<SIV_Decryption>(std::move(bc));
159 return std::unique_ptr<AEAD_Mode>();