SHA-512 hash.
More...
|
| SHA512 () |
| Constructor.
|
|
virtual bool | add (const void *data, size_t size) override |
| Add some part of the message to hash. More...
|
|
virtual size_t | blockSize () const override |
| Size in bytes of the block used by the algorithm. More...
|
|
virtual bool | getHash (void *hash, size_t bufsize, size_t *retsize=nullptr) override |
| Get the resulting hash value. More...
|
|
bool | hash (const void *data, size_t data_size, ByteBlock &hash) |
| Compute a hash in one operation. More...
|
|
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. More...
|
|
virtual size_t | hashSize () const override |
| Size in bytes of the resulting hash. More...
|
|
virtual bool | init () override |
| Reinitialize the computation of the hash. More...
|
|
virtual UString | name () const override |
| Algorithm name (informational only). More...
|
|
|
static const size_t | BLOCK_SIZE = 128 |
| SHA-512 block size in bytes.
|
|
static const size_t | HASH_SIZE = 64 |
| SHA-512 hash size in bytes.
|
|
◆ name()
virtual UString ts::SHA512::name |
( |
| ) |
const |
|
overridevirtual |
Algorithm name (informational only).
- Returns
- The algorithm name.
Implements ts::Hash.
◆ hashSize()
virtual size_t ts::SHA512::hashSize |
( |
| ) |
const |
|
overridevirtual |
Size in bytes of the resulting hash.
- Returns
- The size in bytes of the resulting hash.
Implements ts::Hash.
◆ blockSize()
virtual size_t ts::SHA512::blockSize |
( |
| ) |
const |
|
overridevirtual |
Size in bytes of the block used by the algorithm.
- Returns
- The size in bytes of the block used by the algorithm. Informational only. Can be zero if non significant.
Implements ts::Hash.
◆ init()
virtual bool ts::SHA512::init |
( |
| ) |
|
|
overridevirtual |
Reinitialize the computation of the hash.
- Returns
- True on success, false on error.
Implements ts::Hash.
◆ add()
virtual bool ts::SHA512::add |
( |
const void * |
data, |
|
|
size_t |
size |
|
) |
| |
|
overridevirtual |
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.
Implements ts::Hash.
◆ getHash()
virtual bool ts::SHA512::getHash |
( |
void * |
hash, |
|
|
size_t |
bufsize, |
|
|
size_t * |
retsize = nullptr |
|
) |
| |
|
overridevirtual |
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.
Implements ts::Hash.
◆ 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.
The documentation for this class was generated from the following file: