![]() |
TSDuck v3.46-4930
MPEG Transport Stream Toolkit
|
#include <tsHash.h>

Public Member Functions | |
| virtual | ~Hash () |
| virtual bool | add (const void *data, size_t size) |
| virtual bool | getHash (void *hash, size_t bufsize, size_t *retsize=nullptr) |
| bool | hash (const void *data, size_t data_size, ByteBlock &hash) |
| bool | hash (const void *data, size_t data_size, void *hash, size_t hash_maxsize, size_t *hash_retsize=nullptr) |
| size_t | hashSize () const |
| virtual bool | init () |
| UString | name () const |
Protected Member Functions | |
| Hash (const UChar *name, size_t hash_size) | |
| virtual void | getAlgorithm (::BCRYPT_ALG_HANDLE &algo, size_t &length) const |
| virtual const EVP_MD_CTX * | referenceContext () const |
Base class for all hash functions.
|
virtual |
Virtual destructor.
|
protected |
Constructor for subclasses.
| [in] | name | Algorithm name. |
| [in] | hash_size | Size in bytes of the hash value. |
|
inline |
Algorithm name (informational only).
|
inline |
Size in bytes of the resulting hash.
|
virtual |
Reinitialize the computation of the hash.
|
virtual |
Add some part of the message to hash. Can be called several times.
| [in] | data | Address of message part. |
| [in] | size | Size in bytes of message part. |
|
virtual |
Get the resulting hash value.
| [out] | hash | Address of returned hash buffer. |
| [in] | bufsize | Size in bytes of hash buffer. |
| [out] | retsize | Address of an integer receiving the actual returned hash size. Can be a null pointer (ignored). |
| bool ts::Hash::hash | ( | const void * | data, |
| size_t | data_size, | ||
| void * | hash, | ||
| size_t | hash_maxsize, | ||
| size_t * | hash_retsize = nullptr ) |
Compute a hash in one operation. Same in init() + add() + getHash().
| [in] | data | Address of message to hash. |
| [in] | data_size | Size in bytes of message to hash. |
| [out] | hash | Address of returned hash buffer. |
| [in] | hash_maxsize | Size in bytes of hash buffer. |
| [out] | hash_retsize | Address of an integer receiving the actual returned hash size. Can be a null pointer (ignored). |
| bool ts::Hash::hash | ( | const void * | data, |
| size_t | data_size, | ||
| ByteBlock & | hash ) |
|
protectedvirtual |
Get the algorithm handle and subobject size, when the subclass uses Microsoft BCrypt library.
| [out] | algo | Handle to hash algorithm. |
| [out] | length | Length in bytes of the subobject to allocate. |
Reimplemented in ts::SHA1, ts::SHA256, and ts::SHA512.
|
protectedvirtual |
Get reference hash context, when the subclass uses OpenSSL.