#include <sym_algo.h>

Public Member Functions | |
| virtual std::string | name () const =0 |
| void | set_key (const byte key[], u32bit length) |
| void | set_key (const SymmetricKey &key) |
| SymmetricAlgorithm (u32bit key_min, u32bit key_max, u32bit key_mod) | |
| bool | valid_keylength (u32bit length) const |
| virtual | ~SymmetricAlgorithm () |
Public Attributes | |
| const u32bit | KEYLENGTH_MULTIPLE |
| const u32bit | MAXIMUM_KEYLENGTH |
| const u32bit | MINIMUM_KEYLENGTH |
Definition at line 20 of file sym_algo.h.
| Botan::SymmetricAlgorithm::SymmetricAlgorithm | ( | u32bit | key_min, | |
| u32bit | key_max, | |||
| u32bit | key_mod | |||
| ) | [inline] |
Construct a SymmetricAlgorithm.
| key_min | the minimum allowed key length | |
| key_max | the maximum allowed key length | |
| key_mod | any valid key length must be a multiple of this value |
Definition at line 82 of file sym_algo.h.
00082 : 00083 MAXIMUM_KEYLENGTH(key_max ? key_max : key_min), 00084 MINIMUM_KEYLENGTH(key_min), 00085 KEYLENGTH_MULTIPLE(key_mod) 00086 {}
| virtual Botan::SymmetricAlgorithm::~SymmetricAlgorithm | ( | ) | [inline, virtual] |
| virtual std::string Botan::SymmetricAlgorithm::name | ( | ) | const [pure virtual] |
The name of the algorithm.
Implemented in Botan::AES, Botan::AES_128, Botan::AES_192, Botan::AES_256, Botan::AES_128_Intel, Botan::AES_192_Intel, Botan::AES_256_Intel, Botan::AES_128_SSSE3, Botan::AES_192_SSSE3, Botan::AES_256_SSSE3, Botan::Blowfish, Botan::Cascade_Cipher, Botan::CAST_128, Botan::CAST_256, Botan::DES, Botan::TripleDES, Botan::DESX, Botan::GOST_28147_89, Botan::IDEA, Botan::KASUMI, Botan::Lion, Botan::LubyRackoff, Botan::MARS, Botan::MISTY1, Botan::Noekeon, Botan::RC2, Botan::RC5, Botan::RC6, Botan::SAFER_SK, Botan::SEED, Botan::Serpent, Botan::Skipjack, Botan::Square, Botan::TEA, Botan::Twofish, Botan::XTEA, Botan::CBC_MAC, Botan::CMAC, Botan::HMAC, Botan::MessageAuthenticationCode, Botan::SSL3_MAC, Botan::ANSI_X919_MAC, Botan::ARC4, Botan::CTR_BE, Botan::OFB, Botan::Salsa20, Botan::Turing, and Botan::WiderWake_41_BE.
Referenced by Botan::Algorithm_Factory::add_block_cipher(), Botan::Algorithm_Factory::add_stream_cipher(), Botan::ANSI_X919_MAC::ANSI_X919_MAC(), Botan::CMAC::CMAC(), Botan::OFB::name(), Botan::CTR_BE::name(), Botan::ANSI_X931_RNG::name(), Botan::Randpool::name(), Botan::PBE_PKCS5v20::name(), Botan::PBE_PKCS5v15::name(), Botan::CMAC::name(), Botan::CBC_MAC::name(), Botan::XTS_Decryption::name(), Botan::XTS_Encryption::name(), Botan::ECB_Decryption::name(), Botan::ECB_Encryption::name(), Botan::CBC_Decryption::name(), Botan::CBC_Encryption::name(), Botan::Lion::name(), Botan::Cascade_Cipher::name(), Botan::PBE_PKCS5v15::PBE_PKCS5v15(), Botan::PBE_PKCS5v20::PBE_PKCS5v20(), Botan::Randpool::Randpool(), Botan::StreamCipher::set_iv(), Botan::XTS_Decryption::XTS_Decryption(), and Botan::XTS_Encryption::XTS_Encryption().
Set the symmetric key of this object.
| key | the to be set as a byte array. | |
| length | in bytes of key param |
Definition at line 57 of file sym_algo.h.
00058 { 00059 if(!valid_keylength(length)) 00060 throw Invalid_Key_Length(name(), length); 00061 key_schedule(key, length); 00062 }
| void Botan::SymmetricAlgorithm::set_key | ( | const SymmetricKey & | key | ) | [inline] |
Set the symmetric key of this object.
| key | the SymmetricKey to be set. |
Definition at line 49 of file sym_algo.h.
References Botan::OctetString::begin(), Botan::OctetString::length(), and set_key().
Referenced by Botan::aont_package(), Botan::aont_unpackage(), Botan::Lion::decrypt_n(), Botan::PKCS5_PBKDF2::derive_key(), Botan::ECB_Decryption::ECB_Decryption(), Botan::ECB_Encryption::ECB_Encryption(), Botan::Lion::encrypt_n(), Botan::HMAC_RNG::HMAC_RNG(), Botan::MAC_Filter::MAC_Filter(), Botan::HMAC_RNG::reseed(), set_key(), Botan::XTS_Decryption::set_key(), Botan::XTS_Encryption::set_key(), Botan::EAX_Base::set_key(), Botan::MAC_Filter::set_key(), and Botan::StreamCipher_Filter::StreamCipher_Filter().
00050 { set_key(key.begin(), key.length()); }
| bool Botan::SymmetricAlgorithm::valid_keylength | ( | u32bit | length | ) | const [inline] |
Check whether a given key length is valid for this algorithm.
| length | the key length to be checked. |
Definition at line 69 of file sym_algo.h.
Referenced by Botan::aont_package(), Botan::aont_unpackage(), Botan::HMAC_RNG::HMAC_RNG(), Botan::Lion::Lion(), Botan::Randpool::Randpool(), Botan::XTS_Decryption::set_key(), Botan::XTS_Encryption::set_key(), Botan::EAX_Base::valid_keylength(), Botan::MAC_Filter::valid_keylength(), and Botan::valid_keylength_for().
00070 { 00071 return ((length >= MINIMUM_KEYLENGTH) && 00072 (length <= MAXIMUM_KEYLENGTH) && 00073 (length % KEYLENGTH_MULTIPLE == 0)); 00074 }
A valid keylength is a multiple of this value.
Definition at line 37 of file sym_algo.h.
Referenced by Botan::keylength_multiple_of().
The maximum allowed key length.
Definition at line 27 of file sym_algo.h.
Referenced by Botan::max_keylength_of().
The minimal allowed key length.
Definition at line 32 of file sym_algo.h.
Referenced by Botan::min_keylength_of().
1.5.8