Botan  1.11.15
Public Member Functions
Botan::SymmetricAlgorithm Class Reference

#include <sym_algo.h>

Inheritance diagram for Botan::SymmetricAlgorithm:
Botan::BlockCipher Botan::GHASH Botan::MessageAuthenticationCode Botan::StreamCipher Botan::Block_Cipher_Fixed_Params< 16, 1, 32 > Botan::Block_Cipher_Fixed_Params< 16, 16 > Botan::Block_Cipher_Fixed_Params< 16, 16, 32, 4 > Botan::Block_Cipher_Fixed_Params< 16, 16, 32, 8 > Botan::Block_Cipher_Fixed_Params< 16, 24 > Botan::Block_Cipher_Fixed_Params< 16, 32 > Botan::Block_Cipher_Fixed_Params< 16, 4, 32, 4 > Botan::Block_Cipher_Fixed_Params< 64, 64 > Botan::Block_Cipher_Fixed_Params< 8, 1, 32 > Botan::Block_Cipher_Fixed_Params< 8, 1, 56 > Botan::Block_Cipher_Fixed_Params< 8, 11, 16 > Botan::Block_Cipher_Fixed_Params< 8, 16 > Botan::Block_Cipher_Fixed_Params< 8, 16, 24, 8 > Botan::Block_Cipher_Fixed_Params< 8, 24 > Botan::Block_Cipher_Fixed_Params< 8, 32 > Botan::Block_Cipher_Fixed_Params< 8, 8 > Botan::Block_Cipher_Fixed_Params< BS, KMIN, KMAX, KMOD > Botan::Cascade_Cipher Botan::Lion Botan::ANSI_X919_MAC Botan::CBC_MAC Botan::CMAC Botan::HMAC Botan::Poly1305 Botan::SipHash Botan::ChaCha Botan::CTR_BE Botan::OFB Botan::RC4 Botan::Salsa20

List of all members.

Public Member Functions

virtual void clear ()=0
virtual Key_Length_Specification key_spec () const =0
size_t maximum_keylength () const
size_t minimum_keylength () const
virtual std::string name () const =0
void set_key (const SymmetricKey &key)
template<typename Alloc >
void set_key (const std::vector< byte, Alloc > &key)
void set_key (const byte key[], size_t length)
bool valid_keylength (size_t length) const
virtual ~SymmetricAlgorithm ()

Detailed Description

This class represents a symmetric algorithm object.

Definition at line 21 of file sym_algo.h.


Constructor & Destructor Documentation

virtual Botan::SymmetricAlgorithm::~SymmetricAlgorithm ( ) [inline, virtual]

Definition at line 24 of file sym_algo.h.

{}

Member Function Documentation

virtual void Botan::SymmetricAlgorithm::clear ( ) [pure virtual]
Returns:
minimum allowed key length

Definition at line 36 of file sym_algo.h.

References Botan::Key_Length_Specification::maximum_keylength().

         {
         return key_spec().maximum_keylength();
         }
Returns:
maxmium allowed key length

Definition at line 44 of file sym_algo.h.

         {
         return key_spec().minimum_keylength();
         }
virtual std::string Botan::SymmetricAlgorithm::name ( ) const [pure virtual]
void Botan::SymmetricAlgorithm::set_key ( const SymmetricKey key) [inline]

Set the symmetric key of this object.

Parameters:
keythe SymmetricKey to be set.

Definition at line 63 of file sym_algo.h.

References Botan::OctetString::begin(), and Botan::OctetString::length().

Referenced by Botan::aont_package(), Botan::aont_unpackage(), botan_mac_set_key(), Botan::TLS::Session::decrypt(), Botan::TLS::Session::encrypt(), and Botan::pbkdf2().

         {
         set_key(key.begin(), key.length());
         }
template<typename Alloc >
void Botan::SymmetricAlgorithm::set_key ( const std::vector< byte, Alloc > &  key) [inline]

Definition at line 69 of file sym_algo.h.

         {
         set_key(&key[0], key.size());
         }
void Botan::SymmetricAlgorithm::set_key ( const byte  key[],
size_t  length 
) [inline]

Set the symmetric key of this object.

Parameters:
keythe to be set as a byte array.
lengthin bytes of key param

Definition at line 79 of file sym_algo.h.

         {
         if(!valid_keylength(length))
            throw Invalid_Key_Length(name(), length);
         key_schedule(key, length);
         }
bool Botan::SymmetricAlgorithm::valid_keylength ( size_t  length) const [inline]

Check whether a given key length is valid for this algorithm.

Parameters:
lengththe key length to be checked.
Returns:
true if the key length is valid.

Definition at line 54 of file sym_algo.h.

Referenced by Botan::aont_package(), and Botan::aont_unpackage().

         {
         return key_spec().valid_keylength(length);
         }

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