8 #ifndef BOTAN_STREAM_CIPHER_H__
9 #define BOTAN_STREAM_CIPHER_H__
11 #include <botan/sym_algo.h>
31 static std::unique_ptr<StreamCipher>
32 create(
const std::string& algo_spec,
33 const std::string& provider =
"");
42 static std::unique_ptr<StreamCipher>
43 create_or_throw(
const std::string& algo_spec,
44 const std::string& provider =
"");
49 static std::vector<std::string> providers(
const std::string& algo_spec);
57 virtual void cipher(
const uint8_t in[], uint8_t out[],
size_t len) = 0;
66 { cipher(buf, buf, len); }
73 template<
typename Alloc>
74 void encipher(std::vector<uint8_t, Alloc>& inout)
75 { cipher(inout.data(), inout.data(), inout.size()); }
82 template<
typename Alloc>
83 void encrypt(std::vector<uint8_t, Alloc>& inout)
84 { cipher(inout.data(), inout.data(), inout.size()); }
91 template<
typename Alloc>
92 void decrypt(std::vector<uint8_t, Alloc>& inout)
93 { cipher(inout.data(), inout.data(), inout.size()); }
100 virtual void set_iv(
const uint8_t iv[],
size_t iv_len) = 0;
117 virtual void seek(uint64_t offset) = 0;
123 virtual std::string
provider()
const {
return "base"; }
void cipher1(uint8_t buf[], size_t len)
virtual std::string provider() const
void encrypt(std::vector< uint8_t, Alloc > &inout)
virtual bool valid_iv_length(size_t iv_len) const
void decrypt(std::vector< uint8_t, Alloc > &inout)
void encipher(std::vector< uint8_t, Alloc > &inout)