SHA-512 hash.
More...
#include <tsSHA512.h>
|
| SHA512 () |
| Constructor.
|
|
virtual bool | add (const void *data, size_t size) |
| Add some part of the message to hash.
|
|
virtual bool | getHash (void *hash, size_t bufsize, size_t *retsize=nullptr) |
| Get the resulting hash value.
|
|
bool | hash (const void *data, size_t data_size, ByteBlock &hash) |
| Compute a hash in one operation.
|
|
bool | 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.
|
|
size_t | hashSize () const |
| Size in bytes of the resulting hash.
|
|
virtual bool | init () |
| Reinitialize the computation of the hash.
|
|
UString | name () const |
| Algorithm name (informational only).
|
|
|
static constexpr size_t | HASH_SIZE = 512/8 |
| SHA-512 hash size in bytes (512 bits).
|
|
|
virtual void | getAlgorithm (::BCRYPT_ALG_HANDLE &algo, size_t &length) const override |
| Get the algorithm handle and subobject size, when the subclass uses Microsoft BCrypt library.
|
|
virtual const EVP_MD_CTX * | referenceContext () const |
| Get reference hash context, when the subclass uses OpenSSL.
|
|
◆ getAlgorithm()
virtual void ts::SHA512::getAlgorithm |
( |
::BCRYPT_ALG_HANDLE & |
algo, |
|
|
size_t & |
length |
|
) |
| const |
|
overrideprotectedvirtual |
Get the algorithm handle and subobject size, when the subclass uses Microsoft BCrypt library.
- Parameters
-
[out] | algo | Handle to hash algorithm. |
[out] | length | Length in bytes of the subobject to allocate. |
Reimplemented from ts::Hash.
◆ name()
Algorithm name (informational only).
- Returns
- The algorithm name.
◆ hashSize()
size_t ts::Hash::hashSize |
( |
| ) |
const |
|
inlineinherited |
Size in bytes of the resulting hash.
- Returns
- The size in bytes of the resulting hash.
◆ init()
virtual bool ts::Hash::init |
( |
| ) |
|
|
virtualinherited |
Reinitialize the computation of the hash.
- Returns
- True on success, false on error.
◆ add()
virtual bool ts::Hash::add |
( |
const void * |
data, |
|
|
size_t |
size |
|
) |
| |
|
virtualinherited |
Add some part of the message to hash.
Can be called several times.
- Parameters
-
[in] | data | Address of message part. |
[in] | size | Size in bytes of message part. |
- Returns
- True on success, false on error.
◆ getHash()
virtual bool ts::Hash::getHash |
( |
void * |
hash, |
|
|
size_t |
bufsize, |
|
|
size_t * |
retsize = nullptr |
|
) |
| |
|
virtualinherited |
Get the resulting hash value.
- Parameters
-
[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). |
- Returns
- True on success, false on error.
◆ hash() [1/2]
bool ts::Hash::hash |
( |
const void * |
data, |
|
|
size_t |
data_size, |
|
|
void * |
hash, |
|
|
size_t |
hash_maxsize, |
|
|
size_t * |
hash_retsize = nullptr |
|
) |
| |
|
inherited |
Compute a hash in one operation.
Same in init() + add() + getHash().
- Parameters
-
[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). |
- Returns
- True on success, false on error.
◆ hash() [2/2]
bool ts::Hash::hash |
( |
const void * |
data, |
|
|
size_t |
data_size, |
|
|
ByteBlock & |
hash |
|
) |
| |
|
inherited |
Compute a hash in one operation.
Same in init() + add() + getHash().
- Parameters
-
[in] | data | Address of message to hash. |
[in] | data_size | Size in bytes of message to hash. |
[out] | hash | Returned hash buffer. |
- Returns
- True on success, false on error.
◆ referenceContext()
virtual const EVP_MD_CTX * ts::Hash::referenceContext |
( |
| ) |
const |
|
protectedvirtualinherited |
Get reference hash context, when the subclass uses OpenSSL.
- Returns
- Reference EVP hash context. To be copied into each new hash object.
The documentation for this class was generated from the following file: