#include <filters.h>
|
virtual void | send (const uint8_t in[], size_t length) |
|
void | send (uint8_t in) |
|
void | send (const secure_vector< uint8_t > &in) |
|
void | send (const std::vector< uint8_t > &in) |
|
void | send (const secure_vector< uint8_t > &in, size_t length) |
|
void | send (const std::vector< uint8_t > &in, size_t length) |
|
Stream Cipher Filter
Definition at line 31 of file filters.h.
Botan::StreamCipher_Filter::StreamCipher_Filter |
( |
StreamCipher * |
cipher | ) |
|
|
explicit |
Construct a stream cipher filter.
- Parameters
-
cipher | a cipher object to use |
Definition at line 13 of file algo_filt.cpp.
14 m_buffer(DEFAULT_BUFFERSIZE),
Construct a stream cipher filter.
- Parameters
-
cipher | a cipher object to use |
key | the key to use inside this filter |
Definition at line 19 of file algo_filt.cpp.
20 m_buffer(DEFAULT_BUFFERSIZE),
23 m_cipher->set_key(key);
Botan::StreamCipher_Filter::StreamCipher_Filter |
( |
const std::string & |
cipher | ) |
|
|
explicit |
Construct a stream cipher filter.
- Parameters
-
cipher | the name of the desired cipher |
Definition at line 26 of file algo_filt.cpp.
27 m_buffer(DEFAULT_BUFFERSIZE),
static std::unique_ptr< StreamCipher > create_or_throw(const std::string &algo_spec, const std::string &provider="")
Botan::StreamCipher_Filter::StreamCipher_Filter |
( |
const std::string & |
cipher, |
|
|
const SymmetricKey & |
key |
|
) |
| |
Construct a stream cipher filter.
- Parameters
-
cipher | the name of the desired cipher |
key | the key to use inside this filter |
Definition at line 32 of file algo_filt.cpp.
33 m_buffer(DEFAULT_BUFFERSIZE),
36 m_cipher->set_key(key);
static std::unique_ptr< StreamCipher > create_or_throw(const std::string &algo_spec, const std::string &provider="")
virtual bool Botan::Filter::attachable |
( |
| ) |
|
|
inlinevirtualinherited |
virtual void Botan::Filter::end_msg |
( |
| ) |
|
|
inlinevirtualinherited |
- Returns
- object describing limits on key size
Implements Botan::Keyed_Filter.
Definition at line 62 of file filters.h.
62 {
return m_cipher->key_spec(); }
std::string Botan::StreamCipher_Filter::name |
( |
| ) |
const |
|
inlineoverridevirtual |
- Returns
- descriptive name for this filter
Implements Botan::Filter.
Definition at line 35 of file filters.h.
35 {
return m_cipher->name(); }
void Botan::Filter::send |
( |
const uint8_t |
in[], |
|
|
size_t |
length |
|
) |
| |
|
protectedvirtualinherited |
- Parameters
-
in | some input for the filter |
length | the length of in |
Definition at line 27 of file filter.cpp.
References Botan::Filter::write().
Referenced by Botan::Hex_Encoder::end_msg(), Botan::Base64_Encoder::end_msg(), Botan::Hex_Decoder::end_msg(), Botan::Base64_Decoder::end_msg(), Botan::Hash_Filter::end_msg(), Botan::MAC_Filter::end_msg(), write(), Botan::Hex_Decoder::write(), and Botan::Base64_Decoder::write().
32 bool nothing_attached =
true;
33 for(
size_t j = 0; j != total_ports(); ++j)
36 if(m_write_queue.size())
37 m_next[j]->
write(m_write_queue.data(), m_write_queue.size());
38 m_next[j]->write(input, length);
39 nothing_attached =
false;
43 m_write_queue += std::make_pair(input, length);
45 m_write_queue.clear();
virtual void write(const uint8_t input[], size_t length)=0
void Botan::Filter::send |
( |
uint8_t |
in | ) |
|
|
inlineprotectedinherited |
void Botan::Filter::send |
( |
const std::vector< uint8_t > & |
in | ) |
|
|
inlineprotectedinherited |
void Botan::Filter::send |
( |
const secure_vector< uint8_t > & |
in, |
|
|
size_t |
length |
|
) |
| |
|
inlineprotectedinherited |
- Parameters
-
in | some input for the filter |
length | the number of bytes of in to send |
Definition at line 81 of file filter.h.
83 send(in.data(), length);
virtual void send(const uint8_t in[], size_t length)
void Botan::Filter::send |
( |
const std::vector< uint8_t > & |
in, |
|
|
size_t |
length |
|
) |
| |
|
inlineprotectedinherited |
- Parameters
-
in | some input for the filter |
length | the number of bytes of in to send |
Definition at line 90 of file filter.h.
92 send(in.data(), length);
virtual void send(const uint8_t in[], size_t length)
void Botan::StreamCipher_Filter::set_key |
( |
const SymmetricKey & |
key | ) |
|
|
inlineoverridevirtual |
virtual void Botan::Filter::start_msg |
( |
| ) |
|
|
inlinevirtualinherited |
Start a new message. Must be closed by end_msg() before another message can be started.
Definition at line 40 of file filter.h.
bool Botan::StreamCipher_Filter::valid_iv_length |
( |
size_t |
length | ) |
const |
|
inlineoverridevirtual |
Check whether an IV length is valid for this filter
- Parameters
-
length | the IV length to be checked for validity |
- Returns
- true if the IV length is valid, false otherwise
Reimplemented from Botan::Keyed_Filter.
Definition at line 44 of file filters.h.
45 {
return m_cipher->valid_iv_length(iv_len); }
bool Botan::Keyed_Filter::valid_keylength |
( |
size_t |
length | ) |
const |
|
inlineinherited |
Check whether a key length is valid for this filter
- Parameters
-
length | the key length to be checked for validity |
- Returns
- true if the key length is valid, false otherwise
Definition at line 42 of file key_filt.h.
bool valid_keylength(size_t length) const
virtual Key_Length_Specification key_spec() const =0
void Botan::StreamCipher_Filter::write |
( |
const uint8_t |
input[], |
|
|
size_t |
input_len |
|
) |
| |
|
overridevirtual |
Write input data
- Parameters
-
input | data |
input_len | length of input in bytes |
Implements Botan::Filter.
Definition at line 39 of file algo_filt.cpp.
References Botan::Filter::send().
43 size_t copied = std::min<size_t>(length, m_buffer.size());
44 m_cipher->cipher(input, m_buffer.data(), copied);
45 send(m_buffer, copied);
virtual void send(const uint8_t in[], size_t length)
The documentation for this class was generated from the following files: