#include <filters.h>
◆ MAC_Filter() [1/4]
Construct a MAC filter. The MAC key will be left empty.
- Parameters
-
mac_obj | the MAC to use |
out_len | the output length of this filter. Leave the default value 0 if you want to use the full output of the MAC. Otherwise, specify a smaller value here so that the output of the MAC will be cut off. |
Definition at line 172 of file filters.h.
173 : OUTPUT_LENGTH(out_len)
◆ MAC_Filter() [2/4]
Construct a MAC filter.
- Parameters
-
mac_obj | the MAC to use |
key | the MAC key to use |
out_len | the output length of this filter. Leave the default value 0 if you want to use the full output of the MAC. Otherwise, specify a smaller value here so that the output of the MAC will be cut off. |
Definition at line 187 of file filters.h.
189 : OUTPUT_LENGTH(out_len)
void set_key(const SymmetricKey &key)
◆ MAC_Filter() [3/4]
Botan::MAC_Filter::MAC_Filter |
( |
const std::string & |
mac, |
|
|
size_t |
len = 0 |
|
) |
| |
◆ MAC_Filter() [4/4]
Botan::MAC_Filter::MAC_Filter |
( |
const std::string & |
mac, |
|
|
const SymmetricKey & |
key, |
|
|
size_t |
len = 0 |
|
) |
| |
◆ ~MAC_Filter()
Botan::MAC_Filter::~MAC_Filter |
( |
| ) |
|
|
inline |
◆ attachable()
virtual bool Botan::Filter::attachable |
( |
| ) |
|
|
inlinevirtualinherited |
◆ end_msg()
void Botan::MAC_Filter::end_msg |
( |
| ) |
|
|
virtual |
◆ name()
std::string Botan::MAC_Filter::name |
( |
| ) |
const |
|
inlinevirtual |
- Returns
- descriptive name for this filter
Implements Botan::Filter.
Definition at line 148 of file filters.h.
148 {
return mac->
name(); }
virtual std::string name() const =0
◆ send() [1/4]
void Botan::Filter::send |
( |
const byte |
in[], |
|
|
size_t |
length |
|
) |
| |
|
protectedinherited |
- Parameters
-
in | some input for the filter |
length | the length of in |
Definition at line 28 of file filter.cpp.
References Botan::MemoryRegion< T >::clear(), Botan::MemoryRegion< T >::size(), and Botan::Filter::write().
Referenced by Botan::PK_Encryptor_Filter::end_msg(), Botan::Zlib_Compression::end_msg(), Botan::Bzip_Compression::end_msg(), Botan::Hex_Encoder::end_msg(), Botan::Base64_Encoder::end_msg(), Botan::PK_Decryptor_Filter::end_msg(), Botan::Bzip_Decompression::end_msg(), Botan::Zlib_Decompression::end_msg(), Botan::PK_Signer_Filter::end_msg(), Botan::Hex_Decoder::end_msg(), Botan::Base64_Decoder::end_msg(), Botan::PK_Verifier_Filter::end_msg(), Botan::Hash_Filter::end_msg(), end_msg(), Botan::Bzip_Compression::flush(), Botan::Zlib_Compression::flush(), Botan::Zlib_Compression::write(), Botan::Bzip_Compression::write(), Botan::StreamCipher_Filter::write(), Botan::Bzip_Decompression::write(), Botan::Zlib_Decompression::write(), Botan::Hex_Decoder::write(), and Botan::Base64_Decoder::write().
30 bool nothing_attached =
true;
31 for(
size_t j = 0; j != total_ports(); ++j)
34 if(write_queue.
size())
35 next[j]->
write(&write_queue[0], write_queue.
size());
36 next[j]->write(input, length);
37 nothing_attached =
false;
41 write_queue += std::make_pair(input, length);
virtual void write(const byte input[], size_t length)=0
◆ send() [2/4]
void Botan::Filter::send |
( |
byte |
in | ) |
|
|
inlineprotectedinherited |
◆ send() [3/4]
◆ send() [4/4]
- Parameters
-
in | some input for the filter |
length | the number of bytes of in to send |
Definition at line 74 of file filter.h.
void send(const byte in[], size_t length)
◆ set_iv()
Set the initialization vector of this filter. Note: you should call set_iv() only after you have called set_key()
- Parameters
-
iv | the initialization vector to use |
Reimplemented in Botan::CBC_Decryption, Botan::XTS_Decryption, Botan::CTS_Decryption, Botan::CFB_Decryption, Botan::StreamCipher_Filter, Botan::CBC_Encryption, Botan::EAX_Base, Botan::XTS_Encryption, Botan::CFB_Encryption, and Botan::CTS_Encryption.
Definition at line 13 of file basefilt.cpp.
References Botan::OctetString::length(), and Botan::Filter::name().
Referenced by Botan::get_cipher().
16 throw Invalid_IV_Length(
name(), iv.length());
virtual std::string name() const =0
◆ set_key()
◆ start_msg()
virtual void Botan::Filter::start_msg |
( |
| ) |
|
|
inlinevirtualinherited |
◆ valid_iv_length()
virtual bool Botan::Keyed_Filter::valid_iv_length |
( |
size_t |
length | ) |
const |
|
inlinevirtualinherited |
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 in Botan::CBC_Decryption, Botan::XTS_Decryption, Botan::CTS_Decryption, Botan::CFB_Decryption, Botan::StreamCipher_Filter, Botan::EAX_Base, Botan::CBC_Encryption, Botan::CFB_Encryption, Botan::CTS_Encryption, and Botan::XTS_Encryption.
Definition at line 48 of file key_filt.h.
49 {
return (length == 0); }
◆ valid_keylength()
bool Botan::MAC_Filter::valid_keylength |
( |
size_t |
length | ) |
const |
|
inlinevirtual |
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
Implements Botan::Keyed_Filter.
Definition at line 161 of file filters.h.
bool valid_keylength(size_t length) const
◆ write()
void Botan::MAC_Filter::write |
( |
const byte |
input[], |
|
|
size_t |
length |
|
) |
| |
|
inlinevirtual |
Write a portion of a message to this filter.
- Parameters
-
input | the input as a byte array |
length | the length of the byte array input |
Implements Botan::Filter.
Definition at line 145 of file filters.h.
145 { mac->
update(input, len); }
void update(const byte in[], size_t length)
The documentation for this class was generated from the following files: