8#include <botan/stream_cipher.h>
9#include <botan/scan_name.h>
10#include <botan/exceptn.h>
12#if defined(BOTAN_HAS_CHACHA)
13 #include <botan/chacha.h>
16#if defined(BOTAN_HAS_SALSA20)
17 #include <botan/salsa20.h>
20#if defined(BOTAN_HAS_SHAKE_CIPHER)
21 #include <botan/shake_cipher.h>
24#if defined(BOTAN_HAS_CTR_BE)
25 #include <botan/ctr.h>
28#if defined(BOTAN_HAS_OFB)
29 #include <botan/ofb.h>
32#if defined(BOTAN_HAS_RC4)
33 #include <botan/rc4.h>
39 const std::string& provider)
43#if defined(BOTAN_HAS_CTR_BE)
52 return std::unique_ptr<StreamCipher>(
new CTR_BE(
cipher.release(), ctr_size));
58#if defined(BOTAN_HAS_CHACHA)
68 return std::unique_ptr<StreamCipher>(
new ChaCha(20));
72#if defined(BOTAN_HAS_SALSA20)
76 return std::unique_ptr<StreamCipher>(
new Salsa20);
80#if defined(BOTAN_HAS_SHAKE_CIPHER)
88#if defined(BOTAN_HAS_OFB)
94 return std::unique_ptr<StreamCipher>(
new OFB(c.release()));
99#if defined(BOTAN_HAS_RC4)
109 return std::unique_ptr<StreamCipher>(
new RC4(skip));
122std::unique_ptr<StreamCipher>
124 const std::string& provider)
135 return probe_providers_of<StreamCipher>(algo_spec, {
"base"});
#define BOTAN_UNUSED(...)
static std::unique_ptr< BlockCipher > create(const std::string &algo_spec, const std::string &provider="")
std::string arg(size_t i) const
const std::string & algo_name() const
size_t arg_as_integer(size_t i, size_t def_value) const
bool arg_count_between(size_t lower, size_t upper) const
virtual void cipher(const uint8_t in[], uint8_t out[], size_t len)=0
static std::vector< std::string > providers(const std::string &algo_spec)
static std::unique_ptr< StreamCipher > create(const std::string &algo_spec, const std::string &provider="")
virtual std::string provider() const
static std::unique_ptr< StreamCipher > create_or_throw(const std::string &algo_spec, const std::string &provider="")