Botan
1.10.9
|
#include <mdx_hash.h>
Public Member Functions | |
virtual HashFunction * | clone () const =0 |
void | final (byte out[]) |
SecureVector< byte > | final () |
size_t | hash_block_size () const |
MDx_HashFunction (size_t block_length, bool big_byte_endian, bool big_bit_endian, size_t counter_size=8) | |
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 | 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) |
Protected Member Functions | |
void | add_data (const byte input[], size_t length) |
void | clear () |
virtual void | compress_n (const byte blocks[], size_t block_n)=0 |
virtual void | copy_out (byte buffer[])=0 |
void | final_result (byte output[]) |
virtual void | write_count (byte out[]) |
MDx Hash Function Base Class
Definition at line 18 of file mdx_hash.h.
Botan::MDx_HashFunction::MDx_HashFunction | ( | size_t | block_length, |
bool | big_byte_endian, | ||
bool | big_bit_endian, | ||
size_t | counter_size = 8 |
||
) |
block_length | is the number of bytes per block |
big_byte_endian | specifies if the hash uses big-endian bytes |
big_bit_endian | specifies if the hash uses big-endian bits |
counter_size | specifies the size of the counter var in bytes |
Definition at line 17 of file mdx_hash.cpp.
|
protectedvirtual |
Add more data to the computation
input | is an input buffer |
length | is the length of input in bytes |
Implements Botan::Buffered_Computation.
Definition at line 41 of file mdx_hash.cpp.
References compress_n(), Botan::MemoryRegion< T >::copy(), and Botan::MemoryRegion< T >::size().
|
protectedvirtual |
Zeroize internal state
Implements Botan::Algorithm.
Reimplemented in Botan::SHA_256, Botan::SHA_512, Botan::Tiger, Botan::SHA_224, Botan::RIPEMD_128, Botan::RIPEMD_160, Botan::SHA_160, Botan::SHA_384, and Botan::Whirlpool.
Definition at line 32 of file mdx_hash.cpp.
References Botan::zeroise().
Referenced by Botan::BMW_512::clear(), Botan::Whirlpool::clear(), Botan::MD5::clear(), Botan::SHA_160::clear(), Botan::SHA_384::clear(), Botan::MD4::clear(), Botan::RIPEMD_128::clear(), Botan::RIPEMD_160::clear(), Botan::HAS_160::clear(), Botan::SHA_224::clear(), Botan::Tiger::clear(), Botan::SHA_512::clear(), Botan::SHA_256::clear(), and final_result().
|
pure virtualinherited |
Get a new object representing the same algorithm as *this
Implemented in Botan::SHA_256, Botan::SHA_512, Botan::Comb4P, Botan::Skein_512, Botan::Keccak_1600, Botan::GOST_34_11, Botan::HAS_160, Botan::MD2, Botan::Parallel, Botan::SHA_224, Botan::Tiger, 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::MD4_X86_32, Botan::MD5_X86_32, Botan::SHA_160_SSE2, Botan::SHA_160_X86_32, and Botan::SHA_160_X86_64.
Referenced by Botan::HMAC::clone(), Botan::SSL3_MAC::clone(), Botan::LubyRackoff::clone(), Botan::Lion::clone(), Botan::EMSA4::EMSA4(), Botan::Core_Engine::find_block_cipher(), Botan::Core_Engine::find_hash(), Botan::get_pbe(), and Botan::Algorithm_Factory::make_hash_function().
|
protectedpure virtual |
Run the hash's compression function over a set of blocks
blocks | the input |
block_n | the number of blocks |
Implemented in Botan::SHA_160, Botan::MD4, and Botan::MD5.
Referenced by add_data(), and final_result().
|
protectedpure virtual |
Copy the output to the buffer
buffer | to put the output into |
Implemented in Botan::SHA_160, Botan::MD4, and Botan::MD5.
Referenced by final_result().
|
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.
|
protectedvirtual |
Write the final output to out
out | is an output buffer of output_length() |
Implements Botan::Buffered_Computation.
Definition at line 71 of file mdx_hash.cpp.
References clear(), compress_n(), copy_out(), Botan::MemoryRegion< T >::size(), write_count(), and Botan::zeroise().
|
inlinevirtual |
The hash block size as defined for this algorithm
Reimplemented from Botan::HashFunction.
Definition at line 32 of file mdx_hash.h.
Referenced by Botan::MD4::compress_n(), Botan::MD5::compress_n(), Botan::SHA_160::compress_n(), and write_count().
|
pure virtualinherited |
Implemented in 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::TLS_12_PRF, Botan::AES_192_SSSE3, Botan::TripleDES, Botan::Camellia_192, Botan::SHA_256, Botan::Comb4P, Botan::SHA_512, Botan::MessageAuthenticationCode, Botan::Lion, Botan::PKCS5_PBKDF1, Botan::WiderWake_41_BE, Botan::Skein_512, Botan::Keccak_1600, Botan::CTR_BE, Botan::OFB, Botan::Salsa20, Botan::Cascade_Cipher, Botan::LubyRackoff, Botan::Turing, Botan::RC2, Botan::Blowfish, Botan::OpenPGP_S2K, Botan::AES_128, Botan::AES_128_NI, Botan::TLS_PRF, Botan::KDF1, 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::KDF2, Botan::ARC4, Botan::SSL3_PRF, Botan::X942_PRF, Botan::Parallel, Botan::HMAC, Botan::ANSI_X919_MAC, Botan::GOST_34_11, Botan::HAS_160, Botan::SHA_224, Botan::CBC_MAC, Botan::CMAC, Botan::SSL3_MAC, Botan::PKCS5_PBKDF2, 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::Algorithm_Factory::add_block_cipher(), Botan::Algorithm_Factory::add_hash_function(), Botan::Algorithm_Factory::add_pbkdf(), Botan::Algorithm_Factory::add_stream_cipher(), Botan::ANSI_X919_MAC::ANSI_X919_MAC(), Botan::choose_sig_format(), Botan::CMAC::CMAC(), Botan::Comb4P::Comb4P(), Botan::EMSA2::EMSA2(), Botan::EMSA3::EMSA3(), Botan::HMAC::HMAC(), Botan::SSL3_MAC::name(), Botan::CBC_MAC::name(), Botan::CMAC::name(), Botan::HMAC::name(), Botan::PBE_PKCS5v15::name(), Botan::CBC_Encryption::name(), Botan::ECB_Encryption::name(), Botan::ANSI_X931_RNG::name(), Botan::Randpool::name(), Botan::PBE_PKCS5v20::name(), Botan::Cascade_Cipher::name(), Botan::LubyRackoff::name(), Botan::CTR_BE::name(), Botan::OFB::name(), Botan::Lion::name(), Botan::ECB_Decryption::name(), Botan::CBC_Decryption::name(), Botan::PBE_PKCS5v15::PBE_PKCS5v15(), Botan::PBE_PKCS5v20::PBE_PKCS5v20(), Botan::StreamCipher::set_iv(), and Botan::SSL3_MAC::SSL3_MAC().
|
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 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 |
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().
|
protectedvirtual |
Write the count, if used, to this spot
out | where to write the counter to |
Definition at line 93 of file mdx_hash.cpp.
References hash_block_size(), Botan::Buffered_Computation::output_length(), Botan::store_be(), and Botan::store_le().
Referenced by final_result().