57#if defined(BOTAN_HAS_COMMONCRYPTO)
71#if defined(BOTAN_HAS_STREAM_CIPHER)
73 return std::make_unique<Stream_Cipher_Mode>(std::move(sc));
77#if defined(BOTAN_HAS_AEAD_MODES)
83 if(algo.find(
'/') != std::string::npos) {
84 const std::vector<std::string> algo_parts =
split_on(algo,
'/');
85 const std::string_view cipher_name = algo_parts[0];
88 if(mode_info.empty()) {
89 return std::unique_ptr<Cipher_Mode>();
92 std::ostringstream mode_name;
94 mode_name << mode_info[0] <<
'(' << cipher_name;
95 for(
size_t i = 1; i < mode_info.size(); ++i) {
96 mode_name <<
',' << mode_info[i];
98 for(
size_t i = 2; i < algo_parts.size(); ++i) {
99 mode_name <<
',' << algo_parts[i];
106#if defined(BOTAN_HAS_BLOCK_CIPHER)
111 return std::unique_ptr<Cipher_Mode>();
117 return std::unique_ptr<Cipher_Mode>();
120 #if defined(BOTAN_HAS_MODE_CBC)
122 const std::string padding = spec.
arg(1,
"PKCS7");
124 if(padding ==
"CTS") {
126 return std::make_unique<CTS_Encryption>(std::move(bc));
128 return std::make_unique<CTS_Decryption>(std::move(bc));
135 return std::make_unique<CBC_Encryption>(std::move(bc), std::move(pad));
137 return std::make_unique<CBC_Decryption>(std::move(bc), std::move(pad));
144 #if defined(BOTAN_HAS_MODE_XTS)
147 return std::make_unique<XTS_Encryption>(std::move(bc));
149 return std::make_unique<XTS_Decryption>(std::move(bc));
154 #if defined(BOTAN_HAS_MODE_CFB)
156 const size_t feedback_bits = spec.
arg_as_integer(1, 8 * bc->block_size());
158 return std::make_unique<CFB_Encryption>(std::move(bc), feedback_bits);
160 return std::make_unique<CFB_Decryption>(std::move(bc), feedback_bits);
167 return std::unique_ptr<Cipher_Mode>();