8 #include <botan/stream_cipher.h>
9 #include <botan/scan_name.h>
11 #if defined(BOTAN_HAS_CHACHA)
12 #include <botan/chacha.h>
15 #if defined(BOTAN_HAS_SALSA20)
16 #include <botan/salsa20.h>
19 #if defined(BOTAN_HAS_SHAKE_CIPHER)
20 #include <botan/shake_cipher.h>
23 #if defined(BOTAN_HAS_CTR_BE)
24 #include <botan/ctr.h>
27 #if defined(BOTAN_HAS_OFB)
28 #include <botan/ofb.h>
31 #if defined(BOTAN_HAS_RC4)
32 #include <botan/rc4.h>
35 #if defined(BOTAN_HAS_OPENSSL)
36 #include <botan/internal/openssl.h>
42 const std::string& provider)
46 #if defined(BOTAN_HAS_CTR_BE)
49 if(provider.empty() || provider ==
"base")
52 return std::unique_ptr<StreamCipher>(
new CTR_BE(c.release()));
57 #if defined(BOTAN_HAS_CHACHA)
60 if(provider.empty() || provider ==
"base")
65 #if defined(BOTAN_HAS_SALSA20)
68 if(provider.empty() || provider ==
"base")
69 return std::unique_ptr<StreamCipher>(
new Salsa20);
73 #if defined(BOTAN_HAS_SHAKE_CIPHER)
76 if(provider.empty() || provider ==
"base")
81 #if defined(BOTAN_HAS_OFB)
84 if(provider.empty() || provider ==
"base")
87 return std::unique_ptr<StreamCipher>(
new OFB(c.release()));
92 #if defined(BOTAN_HAS_RC4)
100 #if defined(BOTAN_HAS_OPENSSL)
101 if(provider.empty() || provider ==
"openssl")
103 return std::unique_ptr<StreamCipher>(make_openssl_rc4(skip));
107 if(provider.empty() || provider ==
"base")
109 return std::unique_ptr<StreamCipher>(
new RC4(skip));
122 std::unique_ptr<StreamCipher>
124 const std::string& provider)
135 return probe_providers_of<StreamCipher>(algo_spec, {
"base",
"openssl"});
std::string arg(size_t i) const
static std::unique_ptr< StreamCipher > create_or_throw(const std::string &algo_spec, const std::string &provider="")
size_t arg_as_integer(size_t i, size_t def_value) const
static std::vector< std::string > providers(const std::string &algo_spec)
static std::unique_ptr< BlockCipher > create(const std::string &algo_spec, const std::string &provider="")
const std::string & algo_name() const
static std::unique_ptr< StreamCipher > create(const std::string &algo_spec, const std::string &provider="")