Botan
1.10.9
|
#include <mac.h>
Public Member Functions | |
virtual void | clear ()=0 |
virtual MessageAuthenticationCode * | clone () const =0 |
void | final (byte out[]) |
SecureVector< byte > | final () |
virtual Key_Length_Specification | key_spec () const =0 |
size_t | maximum_keylength () const |
size_t | minimum_keylength () const |
virtual std::string | name () const =0 |
virtual size_t | output_length () const =0 |
SecureVector< byte > | process (const byte in[], size_t length) |
SecureVector< byte > | process (const MemoryRegion< byte > &in) |
SecureVector< byte > | process (const std::string &in) |
void | set_key (const SymmetricKey &key) |
void | set_key (const byte key[], size_t length) |
void | update (const byte in[], size_t length) |
void | update (const MemoryRegion< byte > &in) |
void | update (const std::string &str) |
void | update (byte in) |
template<typename T > | |
void | update_be (const T in) |
bool | valid_keylength (size_t length) const |
virtual bool | verify_mac (const byte in[], size_t length) |
This class represents Message Authentication Code (MAC) objects.
|
pure virtualinherited |
Zeroize internal state
Implemented in Botan::KDF, Botan::AES_256, Botan::AES_256_NI, Botan::AES_256_SSSE3, Botan::Camellia_256, Botan::GOST_28147_89, Botan::AES_192, Botan::AES_192_NI, Botan::Comb4P, Botan::SHA_256, Botan::SHA_512, Botan::AES_192_SSSE3, Botan::TripleDES, Botan::MDx_HashFunction, Botan::Camellia_192, Botan::CTR_BE, Botan::OFB, Botan::Lion, Botan::Skein_512, Botan::Keccak_1600, Botan::WiderWake_41_BE, Botan::Salsa20, Botan::Cascade_Cipher, Botan::LubyRackoff, Botan::Turing, Botan::RC2, Botan::Blowfish, Botan::PBKDF, Botan::Tiger, Botan::GOST_34_11, Botan::AES_128, Botan::AES_128_NI, Botan::HAS_160, Botan::MD2, Botan::SHA_224, Botan::CMAC, Botan::SSL3_MAC, Botan::Adler32, Botan::CRC24, Botan::CRC32, Botan::BMW_512, Botan::MD4, Botan::MD5, Botan::RIPEMD_128, Botan::RIPEMD_160, Botan::SHA_160, Botan::SHA_384, Botan::Whirlpool, Botan::CBC_MAC, Botan::AES_128_SSSE3, Botan::Camellia_128, Botan::CAST_128, Botan::CAST_256, Botan::DES, Botan::DESX, Botan::IDEA, Botan::KASUMI, Botan::MARS, Botan::MISTY1, Botan::Noekeon, Botan::RC5, Botan::RC6, Botan::SAFER_SK, Botan::SEED, Botan::Serpent, Botan::Skipjack, Botan::Square, Botan::TEA, Botan::Twofish, Botan::XTEA, Botan::ARC4, Botan::Parallel, Botan::HMAC, and Botan::ANSI_X919_MAC.
Referenced by Botan::HMAC::clear(), Botan::ANSI_X919_MAC::clear(), Botan::ANSI_X931_RNG::clear(), Botan::CBC_MAC::clear(), Botan::SSL3_MAC::clear(), Botan::Randpool::clear(), Botan::CMAC::clear(), Botan::Cascade_Cipher::clear(), Botan::HMAC_RNG::clear(), Botan::LubyRackoff::clear(), Botan::Lion::clear(), Botan::OFB::clear(), Botan::CTR_BE::clear(), Botan::Comb4P::clear(), and Botan::OpenPGP_S2K::derive_key().
|
pure virtual |
Get a new object representing the same algorithm as *this
Implemented in Botan::ANSI_X919_MAC, Botan::CMAC, Botan::HMAC, Botan::SSL3_MAC, and Botan::CBC_MAC.
Referenced by Botan::Algorithm_Factory::make_mac().
|
inlineinherited |
Complete the computation and retrieve the final result.
out | The byte array to be filled with the result. Must be of length output_length() |
Definition at line 80 of file buf_comp.h.
Referenced by Botan::LubyRackoff::decrypt_n(), Botan::Lion::decrypt_n(), Botan::X942_PRF::derive(), Botan::KDF2::derive(), Botan::KDF1::derive(), Botan::PKCS5_PBKDF2::derive_key(), Botan::OpenPGP_S2K::derive_key(), Botan::PKCS5_PBKDF1::derive_key(), Botan::EMSA2::EMSA2(), Botan::LubyRackoff::encrypt_n(), Botan::Lion::encrypt_n(), Botan::Hash_Filter::end_msg(), Botan::MAC_Filter::end_msg(), Botan::HandshakeHash::final(), Botan::HandshakeHash::final_ssl3(), Botan::Record_Reader::get_record(), Botan::MGF1::mask(), Botan::EMSA3::raw_data(), Botan::Randpool::reseed(), and Botan::HMAC_RNG::reseed().
|
inlineinherited |
Complete the computation and retrieve the final result.
Definition at line 87 of file buf_comp.h.
|
pure virtualinherited |
Implemented in Botan::Block_Cipher_Fixed_Params< BS, KMIN, KMAX, KMOD >, Botan::Block_Cipher_Fixed_Params< 16, 32 >, Botan::Block_Cipher_Fixed_Params< 8, 10 >, Botan::Block_Cipher_Fixed_Params< 16, 16, 32, 4 >, Botan::Block_Cipher_Fixed_Params< 8, 1, 56 >, Botan::Block_Cipher_Fixed_Params< 8, 32 >, Botan::Block_Cipher_Fixed_Params< 16, 16 >, Botan::Block_Cipher_Fixed_Params< 8, 11, 16 >, Botan::Block_Cipher_Fixed_Params< 8, 16, 24, 8 >, Botan::Block_Cipher_Fixed_Params< 16, 16, 32, 8 >, Botan::Block_Cipher_Fixed_Params< 16, 4, 32, 4 >, Botan::Block_Cipher_Fixed_Params< 8, 1, 32 >, Botan::Block_Cipher_Fixed_Params< 16, 24 >, Botan::Block_Cipher_Fixed_Params< 8, 16 >, Botan::Block_Cipher_Fixed_Params< 16, 1, 32 >, Botan::Block_Cipher_Fixed_Params< 8, 8 >, Botan::Block_Cipher_Fixed_Params< 8, 24 >, Botan::Lion, Botan::WiderWake_41_BE, Botan::ARC4, Botan::CTR_BE, Botan::OFB, Botan::CMAC, Botan::HMAC, Botan::SSL3_MAC, Botan::Salsa20, Botan::LubyRackoff, Botan::CBC_MAC, Botan::ANSI_X919_MAC, Botan::Turing, and Botan::Cascade_Cipher.
Referenced by Botan::keylength_multiple_of(), Botan::max_keylength_of(), and Botan::min_keylength_of().
|
inlineinherited |
Definition at line 33 of file sym_algo.h.
|
inlineinherited |
Definition at line 41 of file sym_algo.h.
|
pure virtual |
Get the name of this algorithm.
Implements Botan::Algorithm.
Implemented in Botan::HMAC, Botan::ANSI_X919_MAC, Botan::CBC_MAC, Botan::CMAC, and Botan::SSL3_MAC.
Referenced by Botan::Algorithm_Factory::add_mac(), Botan::HMAC_RNG::HMAC_RNG(), Botan::Randpool::name(), and Botan::HMAC_RNG::name().
|
pure virtualinherited |
Implemented in Botan::SHA_256, Botan::SHA_512, Botan::Comb4P, Botan::Skein_512, Botan::Keccak_1600, Botan::Parallel, Botan::HMAC, Botan::CBC_MAC, Botan::ANSI_X919_MAC, Botan::GOST_34_11, Botan::HAS_160, Botan::SHA_224, Botan::CMAC, Botan::SSL3_MAC, Botan::Adler32, Botan::CRC24, Botan::CRC32, Botan::BMW_512, Botan::MD2, Botan::MD4, Botan::MD5, Botan::RIPEMD_128, Botan::RIPEMD_160, Botan::SHA_160, Botan::SHA_384, Botan::Tiger, and Botan::Whirlpool.
Referenced by Botan::choose_sig_format(), Botan::Comb4P::Comb4P(), Botan::LubyRackoff::decrypt_n(), Botan::PKCS5_PBKDF2::derive_key(), Botan::OpenPGP_S2K::derive_key(), Botan::PKCS5_PBKDF1::derive_key(), Botan::EAX_Base::EAX_Base(), Botan::EMSA3::encoding_of(), Botan::LubyRackoff::encrypt_n(), Botan::HMAC_RNG::HMAC_RNG(), Botan::output_length_of(), Botan::Randpool::Randpool(), Botan::Record_Writer::set_keys(), Botan::Record_Reader::set_keys(), Botan::EMSA3::verify(), and Botan::MDx_HashFunction::write_count().
|
inlineinherited |
Update and finalize computation. Does the same as calling update() and final() consecutively.
in | the input to process as a byte array |
length | the length of the byte array |
Definition at line 101 of file buf_comp.h.
Referenced by Botan::Randpool::add_entropy(), Botan::EME1::EME1(), Botan::RTSS_Share::split(), and Botan::Cert_Extension::Subject_Key_ID::Subject_Key_ID().
|
inlineinherited |
Update and finalize computation. Does the same as calling update() and final() consecutively.
in | the input to process |
Definition at line 113 of file buf_comp.h.
References Botan::MemoryRegion< T >::size().
|
inlineinherited |
Update and finalize computation. Does the same as calling update() and final() consecutively.
in | the input to process as a string |
Definition at line 125 of file buf_comp.h.
|
inlineinherited |
Set the symmetric key of this object.
key | the SymmetricKey to be set. |
Definition at line 60 of file sym_algo.h.
References Botan::OctetString::begin(), and Botan::OctetString::length().
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(), Botan::XTS_Encryption::set_key(), Botan::EAX_Base::set_key(), Botan::XTS_Decryption::set_key(), Botan::Record_Writer::set_keys(), Botan::Record_Reader::set_keys(), and Botan::StreamCipher_Filter::StreamCipher_Filter().
|
inlineinherited |
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 68 of file sym_algo.h.
|
inlineinherited |
Add new input to process.
in | the input to process as a byte array |
length | of param in in bytes |
Definition at line 33 of file buf_comp.h.
Referenced by Botan::HMAC_RNG::add_entropy(), Botan::Comb4P::clear(), Botan::LubyRackoff::decrypt_n(), Botan::Lion::decrypt_n(), Botan::X942_PRF::derive(), Botan::KDF2::derive(), Botan::KDF1::derive(), Botan::PKCS5_PBKDF2::derive_key(), Botan::OpenPGP_S2K::derive_key(), Botan::PKCS5_PBKDF1::derive_key(), Botan::LubyRackoff::encrypt_n(), Botan::Lion::encrypt_n(), Botan::HandshakeHash::final(), Botan::HandshakeHash::final_ssl3(), Botan::Record_Reader::get_record(), Botan::MGF1::mask(), Botan::HMAC_RNG::reseed(), Botan::EAX_Base::start_msg(), and Botan::EMSA3::update().
|
inlineinherited |
Add new input to process.
in | the input to process as a MemoryRegion |
Definition at line 39 of file buf_comp.h.
References Botan::MemoryRegion< T >::size().
|
inlineinherited |
Add new input to process.
str | the input to process as a std::string. Will be interpreted as a byte array based on the strings encoding. |
Definition at line 63 of file buf_comp.h.
|
inlineinherited |
|
inlineinherited |
Add an integer in big-endian order
in | the value |
Definition at line 48 of file buf_comp.h.
References Botan::get_byte().
Referenced by Botan::KDF2::derive(), Botan::PKCS5_PBKDF2::derive_key(), Botan::Record_Reader::get_record(), and Botan::MGF1::mask().
|
inlineinherited |
Check whether a given key length is valid for this algorithm.
length | the key length to be checked. |
Definition at line 51 of file sym_algo.h.
Referenced by Botan::aont_package(), Botan::aont_unpackage(), Botan::HMAC_RNG::HMAC_RNG(), Botan::Lion::Lion(), Botan::Randpool::Randpool(), and Botan::EAX_Base::valid_keylength().
|
virtual |
Verify a MAC.
in | the MAC to verify as a byte array |
length | the length of param in |
Definition at line 16 of file mac.cpp.
References Botan::same_mem(), and Botan::MemoryRegion< T >::size().