8 #ifndef BOTAN_FILTERS_H__
9 #define BOTAN_FILTERS_H__
11 #include <botan/block_cipher.h>
12 #include <botan/stream_cipher.h>
13 #include <botan/hash.h>
14 #include <botan/mac.h>
16 #include <botan/pipe.h>
17 #include <botan/basefilt.h>
18 #include <botan/key_filt.h>
19 #include <botan/data_snk.h>
21 #if defined(BOTAN_HAS_CODEC_FILTERS)
22 #include <botan/b64_filt.h>
23 #include <botan/hex_filt.h>
35 std::string
name()
const override {
return m_cipher->name(); }
42 void write(
const uint8_t input[],
size_t input_len)
override;
45 {
return m_cipher->valid_iv_length(iv_len); }
91 std::unique_ptr<StreamCipher> m_cipher;
100 void write(
const uint8_t input[],
size_t len)
override {
m_hash->update(input, len); }
101 void end_msg()
override;
114 m_hash(hash), m_out_len(len) {}
124 Hash_Filter(
const std::string& request,
size_t len = 0);
127 std::unique_ptr<HashFunction>
m_hash;
128 const size_t m_out_len;
137 void write(
const uint8_t input[],
size_t len)
override {
m_mac->update(input, len); }
138 void end_msg()
override;
140 std::string
name()
const override {
return m_mac->name(); }
159 size_t out_len = 0) :
176 size_t out_len = 0) :
191 MAC_Filter(
const std::string& mac,
size_t len = 0);
205 std::unique_ptr<MessageAuthenticationCode>
m_mac;
206 const size_t m_out_len;
void set_iv(const InitializationVector &iv) override
Key_Length_Specification key_spec() const override
std::unique_ptr< MessageAuthenticationCode > m_mac
std::string name() const override
void write(const uint8_t input[], size_t len) override
bool valid_iv_length(size_t iv_len) const override
void set_key(const SymmetricKey &key) override
std::vector< T, secure_allocator< T >> secure_vector
void write(const uint8_t input[], size_t len) override
std::string name() const override
Key_Length_Specification key_spec() const override
std::string name() const override
MAC_Filter(MessageAuthenticationCode *mac, const SymmetricKey &key, size_t out_len=0)
Hash_Filter(HashFunction *hash, size_t len=0)
const uint8_t * begin() const
std::unique_ptr< HashFunction > m_hash
MAC_Filter(MessageAuthenticationCode *mac, size_t out_len=0)
void set_key(const SymmetricKey &key) override