Botan
2.19.1
Crypto and TLS for C++11
|
#include <hash.h>
Public Member Functions | |
virtual void | clear ()=0 |
virtual HashFunction * | clone () const =0 |
virtual std::unique_ptr< HashFunction > | copy_state () const =0 |
void | final (uint8_t out[]) |
secure_vector< uint8_t > | final () |
template<typename Alloc > | |
void | final (std::vector< uint8_t, Alloc > &out) |
std::vector< uint8_t > | final_stdvec () |
virtual size_t | hash_block_size () const |
virtual std::string | name () const =0 |
virtual size_t | output_length () const =0 |
secure_vector< uint8_t > | process (const uint8_t in[], size_t length) |
secure_vector< uint8_t > | process (const secure_vector< uint8_t > &in) |
secure_vector< uint8_t > | process (const std::vector< uint8_t > &in) |
secure_vector< uint8_t > | process (const std::string &in) |
virtual std::string | provider () const |
void | update (const uint8_t in[], size_t length) |
void | update (const secure_vector< uint8_t > &in) |
void | update (const std::vector< uint8_t > &in) |
void | update (const std::string &str) |
void | update (uint8_t in) |
void | update_be (uint16_t val) |
void | update_be (uint32_t val) |
void | update_be (uint64_t val) |
void | update_le (uint16_t val) |
void | update_le (uint32_t val) |
void | update_le (uint64_t val) |
virtual | ~HashFunction ()=default |
Static Public Member Functions | |
static std::unique_ptr< HashFunction > | create (const std::string &algo_spec, const std::string &provider="") |
static std::unique_ptr< HashFunction > | create_or_throw (const std::string &algo_spec, const std::string &provider="") |
static std::vector< std::string > | providers (const std::string &algo_spec) |
|
virtualdefault |
|
pure virtual |
Reset the state.
Implemented in Botan::SHA_512_256, Botan::SHAKE_256, Botan::SHA_256, Botan::SHA_512, Botan::Comb4P, Botan::MDx_HashFunction, Botan::Skein_512, Botan::Keccak_1600, Botan::SHA_3, Botan::SHAKE_128, Botan::BLAKE2b, Botan::SM3, Botan::Tiger, Botan::GOST_34_11, Botan::CRC24, Botan::SHA_224, Botan::SHA_384, Botan::Adler32, Botan::CRC32, Botan::MD4, Botan::MD5, Botan::RIPEMD_160, Botan::SHA_160, Botan::Whirlpool, Botan::Streebog, and Botan::Parallel.
Referenced by Botan::Adler32::Adler32(), botan_hash_clear(), Botan::CRC24::CRC24(), Botan::CRC32::CRC32(), Botan::Adler32::~Adler32(), Botan::CRC24::~CRC24(), and Botan::CRC32::~CRC32().
|
pure virtual |
Implemented in Botan::SHA_512_256, Botan::SHAKE_256, Botan::SHA_256, Botan::SHA_512, Botan::Comb4P, Botan::Skein_512, Botan::Keccak_1600, Botan::SHA_3, Botan::SHAKE_128, Botan::BLAKE2b, Botan::SM3, Botan::GOST_34_11, Botan::CRC24, Botan::Parallel, Botan::SHA_224, Botan::Streebog, Botan::Tiger, Botan::Adler32, Botan::CRC32, Botan::MD4, Botan::MD5, Botan::RIPEMD_160, Botan::SHA_160, Botan::SHA_384, and Botan::Whirlpool.
|
pure virtual |
Return a new hash object with the same state as *this. This allows computing the hash of several messages with a common prefix more efficiently than would otherwise be possible.
This function should be called clone
but that was already used for the case of returning an uninitialized object.
Implemented in Botan::SHA_512_256, Botan::SHAKE_256, Botan::SHA_256, Botan::SHA_512, Botan::Comb4P, Botan::Skein_512, Botan::BLAKE2b, Botan::Keccak_1600, Botan::SHA_3, Botan::SHAKE_128, Botan::SM3, Botan::Streebog, Botan::Tiger, Botan::GOST_34_11, Botan::CRC24, Botan::Parallel, Botan::SHA_224, Botan::Adler32, Botan::CRC32, Botan::MD4, Botan::MD5, Botan::RIPEMD_160, Botan::SHA_160, Botan::SHA_384, and Botan::Whirlpool.
|
static |
Create an instance based on a name, or return null if the algo/provider combination cannot be found. If provider is empty then best available is chosen.
Definition at line 106 of file hash.cpp.
References Botan::SCAN_Name::algo_name(), Botan::SCAN_Name::arg(), Botan::SCAN_Name::arg_as_integer(), Botan::SCAN_Name::arg_count(), hash, Botan::make_commoncrypto_hash(), and Botan::make_openssl_hash().
Referenced by botan_hash_init(), botan_pubkey_fingerprint(), Botan::BlockCipher::create(), Botan::KDF::create(), Botan::MessageAuthenticationCode::create(), Botan::PBKDF::create(), Botan::PasswordHashFamily::create(), create_or_throw(), Botan::Certificate_Store_In_Memory::find_cert_by_pubkey_sha1(), Botan::Certificate_Store_In_Memory::find_cert_by_raw_subject_dn_sha256(), Botan::get_eme(), Botan::get_emsa(), and Botan::X942_PRF::kdf().
|
static |
Create an instance based on a name If provider is empty then best available is chosen.
algo_spec | algorithm name |
provider | provider implementation to use Throws Lookup_Error if not found. |
Definition at line 344 of file hash.cpp.
References create(), and hash.
Referenced by Botan::argon2(), Botan::bcrypt_pbkdf(), botan_pubkey_sm2_compute_za(), Botan::OCSP::CertID::CertID(), Botan::create_hex_fingerprint(), Botan::Sodium::crypto_hash_sha256(), Botan::Sodium::crypto_hash_sha512(), Botan::EMSA_PKCS1v15_Raw::EMSA_PKCS1v15_Raw(), Botan::TLS::Handshake_Hash::final(), Botan::generate_dsa_primes(), Botan::OCSP::CertID::is_id_for(), Botan::TLS::make_hello_random(), Botan::newhope_shareda(), Botan::newhope_sharedb(), Botan::Roughtime::nonce_from_blind(), Botan::RTSS_Share::split(), and Botan::Cert_Extension::Subject_Key_ID::Subject_Key_ID().
|
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 83 of file buf_comp.h.
Referenced by botan_hash_final(), botan_mac_final(), Botan::ed25519_gen_keypair(), Botan::ed25519_sign(), Botan::ed25519_verify(), Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::finish(), Botan::TLS::TLS_CBC_HMAC_AEAD_Decryption::finish(), Botan::mgf1_mask(), Botan::pbkdf2(), and Botan::sm2_compute_za().
|
inlineinherited |
Complete the computation and retrieve the final result.
Definition at line 90 of file buf_comp.h.
|
inlineinherited |
Definition at line 105 of file buf_comp.h.
|
inlineinherited |
Definition at line 97 of file buf_comp.h.
|
inlinevirtual |
Reimplemented in Botan::SHAKE_256, Botan::MDx_HashFunction, Botan::Skein_512, Botan::Keccak_1600, Botan::SHA_3, Botan::SHAKE_128, Botan::BLAKE2b, Botan::Comb4P, Botan::Streebog, and Botan::GOST_34_11.
Definition at line 75 of file hash.h.
Referenced by botan_hash_block_size().
|
pure virtual |
Implemented in Botan::SHA_512_256, Botan::SHAKE_256, Botan::SHA_256, Botan::SHA_512, Botan::Comb4P, Botan::Skein_512, Botan::Keccak_1600, Botan::SHA_3, Botan::SHAKE_128, Botan::BLAKE2b, Botan::SM3, Botan::Streebog, Botan::Parallel, Botan::CRC24, Botan::GOST_34_11, Botan::SHA_224, Botan::Adler32, Botan::CRC32, Botan::MD4, Botan::MD5, Botan::RIPEMD_160, Botan::SHA_160, Botan::SHA_384, Botan::Tiger, and Botan::Whirlpool.
Referenced by Botan::EMSA_X931::EMSA_X931().
|
pure virtualinherited |
Implemented in Botan::SHA_512_256, Botan::SHAKE_256, Botan::SHA_256, Botan::SHA_512, Botan::Skein_512, Botan::Keccak_1600, Botan::SHA_3, Botan::SHAKE_128, Botan::Comb4P, Botan::GMAC, Botan::BLAKE2b, Botan::Poly1305, Botan::Parallel, Botan::SM3, Botan::HMAC, Botan::SipHash, Botan::CBC_MAC, Botan::ANSI_X919_MAC, Botan::CRC24, Botan::GOST_34_11, Botan::SHA_224, Botan::CMAC, Botan::Adler32, Botan::CRC32, Botan::MD4, Botan::MD5, Botan::RIPEMD_160, Botan::SHA_160, Botan::SHA_384, Botan::Streebog, Botan::Tiger, and Botan::Whirlpool.
Referenced by botan_hash_output_length(), botan_mac_output_length(), Botan::Tiger::clone(), Botan::mgf1_mask(), Botan::pbkdf2(), Botan::sm2_compute_za(), 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 118 of file buf_comp.h.
|
inlineinherited |
Update and finalize computation. Does the same as calling update() and final() consecutively.
in | the input to process |
Definition at line 130 of file buf_comp.h.
|
inlineinherited |
Update and finalize computation. Does the same as calling update() and final() consecutively.
in | the input to process |
Definition at line 142 of file buf_comp.h.
|
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 154 of file buf_comp.h.
References update.
|
inlinevirtual |
Reimplemented in Botan::SHA_512_256, Botan::SHA_256, Botan::SHA_512, Botan::SHA_3, Botan::SHA_224, and Botan::SHA_384.
|
static |
|
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_hash_update(), botan_mac_update(), Botan::ed25519_gen_keypair(), Botan::ed25519_sign(), Botan::ed25519_verify(), Botan::TLS::TLS_CBC_HMAC_AEAD_Encryption::finish(), Botan::TLS::TLS_CBC_HMAC_AEAD_Decryption::finish(), Botan::mgf1_mask(), Botan::pbkdf2(), and Botan::sm2_compute_za().
|
inlineinherited |
Add new input to process.
in | the input to process as a secure_vector |
Definition at line 39 of file buf_comp.h.
|
inlineinherited |
Add new input to process.
in | the input to process as a std::vector |
Definition at line 48 of file buf_comp.h.
|
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 66 of file buf_comp.h.
References Botan::cast_char_ptr_to_uint8().
|
inlineinherited |
|
inherited |
Definition at line 12 of file buf_comp.cpp.
References Botan::store_be().
Referenced by Botan::mgf1_mask(), and Botan::pbkdf2().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |