56#if defined(BOTAN_HAS_COMMONCRYPTO)
70#if defined(BOTAN_HAS_STREAM_CIPHER)
72 return std::make_unique<Stream_Cipher_Mode>(std::move(sc));
76#if defined(BOTAN_HAS_AEAD_MODES)
82 if(algo.find(
'/') != std::string::npos) {
83 const std::vector<std::string> algo_parts =
split_on(algo,
'/');
84 std::string_view cipher_name = algo_parts[0];
87 if(mode_info.empty()) {
88 return std::unique_ptr<Cipher_Mode>();
91 std::ostringstream mode_name;
93 mode_name << mode_info[0] <<
'(' << cipher_name;
94 for(
size_t i = 1; i < mode_info.size(); ++i) {
95 mode_name <<
',' << mode_info[i];
97 for(
size_t i = 2; i < algo_parts.size(); ++i) {
98 mode_name <<
',' << algo_parts[i];
105#if defined(BOTAN_HAS_BLOCK_CIPHER)
110 return std::unique_ptr<Cipher_Mode>();
116 return std::unique_ptr<Cipher_Mode>();
119 #if defined(BOTAN_HAS_MODE_CBC)
121 const std::string padding = spec.
arg(1,
"PKCS7");
123 if(padding ==
"CTS") {
125 return std::make_unique<CTS_Encryption>(std::move(bc));
127 return std::make_unique<CTS_Decryption>(std::move(bc));
134 return std::make_unique<CBC_Encryption>(std::move(bc), std::move(pad));
136 return std::make_unique<CBC_Decryption>(std::move(bc), std::move(pad));
143 #if defined(BOTAN_HAS_MODE_XTS)
146 return std::make_unique<XTS_Encryption>(std::move(bc));
148 return std::make_unique<XTS_Decryption>(std::move(bc));
153 #if defined(BOTAN_HAS_MODE_CFB)
155 const size_t feedback_bits = spec.
arg_as_integer(1, 8 * bc->block_size());
157 return std::make_unique<CFB_Encryption>(std::move(bc), feedback_bits);
159 return std::make_unique<CFB_Decryption>(std::move(bc), feedback_bits);
166 return std::unique_ptr<Cipher_Mode>();