8 #ifndef BOTAN_STREAM_CIPHER_H_
9 #define BOTAN_STREAM_CIPHER_H_
11 #include <botan/sym_algo.h>
33 static std::unique_ptr<StreamCipher>
34 create(
const std::string& algo_spec,
35 const std::string& provider =
"");
44 static std::unique_ptr<StreamCipher>
45 create_or_throw(
const std::string& algo_spec,
46 const std::string& provider =
"");
51 static std::vector<std::string> providers(
const std::string& algo_spec);
59 virtual void cipher(
const uint8_t in[], uint8_t out[],
size_t len) = 0;
79 { cipher(buf, buf, len); }
86 template<
typename Alloc>
87 void encipher(std::vector<uint8_t, Alloc>& inout)
88 { cipher(inout.data(), inout.data(), inout.size()); }
95 template<
typename Alloc>
96 void encrypt(std::vector<uint8_t, Alloc>& inout)
97 { cipher(inout.data(), inout.data(), inout.size()); }
104 template<
typename Alloc>
105 void decrypt(std::vector<uint8_t, Alloc>& inout)
106 { cipher(inout.data(), inout.data(), inout.size()); }
113 virtual void set_iv(
const uint8_t iv[],
size_t iv_len) = 0;
136 virtual void seek(uint64_t offset) = 0;
142 virtual std::string
provider()
const {
return "base"; }
void cipher1(uint8_t buf[], size_t len)
void clear_mem(T *ptr, size_t n)
#define BOTAN_PUBLIC_API(maj, min)
virtual std::string provider() const
void encrypt(std::vector< uint8_t, Alloc > &inout)
virtual void write_keystream(uint8_t out[], size_t len)
virtual bool valid_iv_length(size_t iv_len) const
virtual size_t default_iv_length() const
void decrypt(std::vector< uint8_t, Alloc > &inout)
void encipher(std::vector< uint8_t, Alloc > &inout)