Botan::Keyed_Filter Class Reference

#include <key_filt.h>

Inheritance diagram for Botan::Keyed_Filter:

Botan::Filter Botan::CBC_Decryption Botan::CBC_Encryption Botan::CFB_Decryption Botan::CFB_Encryption Botan::CTS_Decryption Botan::CTS_Encryption Botan::EAX_Base Botan::ECB_Decryption Botan::ECB_Encryption Botan::MAC_Filter Botan::StreamCipher_Filter Botan::XTS_Decryption Botan::XTS_Encryption

List of all members.

Public Member Functions

virtual bool attachable ()
virtual void end_msg ()
virtual std::string name () const =0
virtual void set_iv (const InitializationVector &iv)
virtual void set_key (const SymmetricKey &key)=0
virtual void start_msg ()
virtual bool valid_iv_length (u32bit length) const
virtual bool valid_keylength (u32bit length) const =0
virtual void write (const byte input[], u32bit length)=0

Protected Member Functions

void send (const MemoryRegion< byte > &in)
void send (byte in)
void send (const byte in[], u32bit length)


Detailed Description

This class represents keyed filters, i.e. filters that have to be fed with a key in order to function.

Definition at line 20 of file key_filt.h.


Member Function Documentation

virtual bool Botan::Filter::attachable (  )  [inline, virtual, inherited]

Check whether this filter is an attachable filter.

Returns:
true if this filter is attachable, false otherwise

Reimplemented in Botan::DataSink, and Botan::SecureQueue.

Definition at line 50 of file filter.h.

00050 { return true; }

virtual void Botan::Filter::end_msg (  )  [inline, virtual, inherited]

virtual std::string Botan::Filter::name (  )  const [pure virtual, inherited]

void Botan::Filter::send ( const MemoryRegion< byte > &  in  )  [inline, protected, inherited]

Parameters:
in some input for the filter

Definition at line 68 of file filter.h.

References Botan::MemoryRegion< T >::begin(), Botan::Filter::send(), and Botan::MemoryRegion< T >::size().

Referenced by Botan::Filter::send().

00068 { send(in.begin(), in.size()); }

void Botan::Filter::send ( byte  in  )  [inline, protected, inherited]

Parameters:
in some input for the filter

Definition at line 63 of file filter.h.

References Botan::Filter::send().

Referenced by Botan::Filter::send().

00063 { send(&in, 1); }

void Botan::Filter::send ( const byte  in[],
u32bit  length 
) [protected, inherited]

Parameters:
in some input for the filter
length the length of in

Definition at line 28 of file filter.cpp.

References Botan::MemoryRegion< T >::append(), Botan::MemoryRegion< T >::destroy(), Botan::MemoryRegion< T >::size(), and Botan::Filter::write().

Referenced by Botan::Zlib_Decompression::end_msg(), Botan::Zlib_Compression::end_msg(), Botan::PK_Verifier_Filter::end_msg(), Botan::PK_Signer_Filter::end_msg(), Botan::PK_Decryptor_Filter::end_msg(), Botan::PK_Encryptor_Filter::end_msg(), Botan::Hex_Encoder::end_msg(), Botan::Bzip_Decompression::end_msg(), Botan::Bzip_Compression::end_msg(), Botan::Base64_Decoder::end_msg(), Botan::Base64_Encoder::end_msg(), Botan::MAC_Filter::end_msg(), Botan::Hash_Filter::end_msg(), Botan::Zlib_Compression::flush(), Botan::Bzip_Compression::flush(), Botan::Zlib_Decompression::write(), Botan::Zlib_Compression::write(), Botan::Bzip_Decompression::write(), Botan::Bzip_Compression::write(), and Botan::StreamCipher_Filter::write().

00029    {
00030    bool nothing_attached = true;
00031    for(u32bit j = 0; j != total_ports(); ++j)
00032       if(next[j])
00033          {
00034          if(write_queue.size())
00035             next[j]->write(write_queue, write_queue.size());
00036          next[j]->write(input, length);
00037          nothing_attached = false;
00038          }
00039 
00040    if(nothing_attached)
00041       write_queue.append(input, length);
00042    else
00043       write_queue.destroy();
00044    }

void Botan::Keyed_Filter::set_iv ( const InitializationVector iv  )  [virtual]

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::StreamCipher_Filter, Botan::CBC_Encryption, Botan::CBC_Decryption, Botan::CFB_Encryption, Botan::CFB_Decryption, Botan::CTS_Encryption, Botan::CTS_Decryption, Botan::EAX_Base, Botan::XTS_Encryption, and Botan::XTS_Decryption.

Definition at line 13 of file basefilt.cpp.

References Botan::OctetString::length(), and Botan::Filter::name().

Referenced by Botan::algorithm_kat(), and Botan::get_cipher().

00014    {
00015    if(iv.length() != 0)
00016       throw Invalid_IV_Length(name(), iv.length());
00017    }

virtual void Botan::Keyed_Filter::set_key ( const SymmetricKey key  )  [pure virtual]

virtual void Botan::Filter::start_msg (  )  [inline, virtual, inherited]

Start a new message. Must be closed by end_msg() before another message can be started.

Reimplemented in Botan::Bzip_Compression, Botan::Bzip_Decompression, Botan::EAX_Base, Botan::Zlib_Compression, Botan::Zlib_Decompression, Botan::PBE_PKCS5v15, and Botan::PBE_PKCS5v20.

Definition at line 38 of file filter.h.

00038 {}

virtual bool Botan::Keyed_Filter::valid_iv_length ( u32bit  length  )  const [inline, virtual]

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::StreamCipher_Filter, Botan::CBC_Encryption, Botan::CBC_Decryption, Botan::CFB_Encryption, Botan::CFB_Decryption, Botan::CTS_Encryption, Botan::CTS_Decryption, Botan::EAX_Base, Botan::XTS_Encryption, and Botan::XTS_Decryption.

Definition at line 48 of file key_filt.h.

Referenced by Botan::algorithm_kat().

00049          { return (length == 0); }

virtual bool Botan::Keyed_Filter::valid_keylength ( u32bit  length  )  const [pure virtual]

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

Implemented in Botan::StreamCipher_Filter, Botan::MAC_Filter, Botan::CBC_Encryption, Botan::CBC_Decryption, Botan::CFB_Encryption, Botan::CFB_Decryption, Botan::CTS_Encryption, Botan::CTS_Decryption, Botan::EAX_Base, Botan::ECB_Encryption, Botan::ECB_Decryption, Botan::XTS_Encryption, and Botan::XTS_Decryption.

virtual void Botan::Filter::write ( const byte  input[],
u32bit  length 
) [pure virtual, inherited]


The documentation for this class was generated from the following files:

Generated on Fri Aug 13 16:20:58 2010 for Botan by  doxygen 1.5.8