BLAKE2s hash algorithm. More...
#include <BLAKE2s.h>
Public Member Functions | |
BLAKE2s () | |
Constructs a BLAKE2s hash object. | |
virtual | ~BLAKE2s () |
Destroys this BLAKE2s hash object after clearing sensitive information. | |
size_t | hashSize () const |
Size of the hash result from finalize(). More... | |
size_t | blockSize () const |
Size of the internal block used by the hash algorithm. More... | |
void | reset () |
Resets the hash ready for a new hashing process. More... | |
void | reset (uint8_t outputLength) |
Resets the hash ready for a new hashing process with a specified output length. More... | |
void | update (const void *data, size_t len) |
Updates the hash with more data. More... | |
void | finalize (void *hash, size_t len) |
Finalizes the hashing process and returns the hash. More... | |
void | clear () |
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process. More... | |
![]() | |
Hash () | |
Constructs a new hash object. | |
virtual | ~Hash () |
Destroys this hash object. More... | |
BLAKE2s hash algorithm.
BLAKE2s is a variation on the ChaCha stream cipher, designed for hashing, with a 256-bit hash output. It is intended as a high performance replacement for SHA256 for when speed is critical but exact SHA256 compatibility is not.
Reference: https://blake2.net/
|
virtual |
Size of the internal block used by the hash algorithm.
Implements Hash.
Definition at line 66 of file BLAKE2s.cpp.
|
virtual |
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process.
Implements Hash.
Definition at line 164 of file BLAKE2s.cpp.
|
virtual |
Finalizes the hashing process and returns the hash.
hash | The buffer to return the hash value in. |
len | The length of the hash buffer, normally hashSize(). |
If len is less than hashSize(), then the hash value will be truncated to the first len bytes. If len is greater than hashSize(), then the remaining bytes will left unchanged.
If finalize() is called again, the same hash value is returned again until the next call to reset() or update().
Implements Hash.
Definition at line 144 of file BLAKE2s.cpp.
|
virtual |
Size of the hash result from finalize().
Implements Hash.
Definition at line 61 of file BLAKE2s.cpp.
|
virtual |
Resets the hash ready for a new hashing process.
Implements Hash.
Definition at line 81 of file BLAKE2s.cpp.
void BLAKE2s::reset | ( | uint8_t | outputLength | ) |
Resets the hash ready for a new hashing process with a specified output length.
outputLength | The output length to use for the final hash in bytes, between 1 and 32. |
Definition at line 103 of file BLAKE2s.cpp.
|
virtual |
Updates the hash with more data.
data | Data to be hashed. |
len | Number of bytes of data to be hashed. |
If finalize() has already been called, then calling update() will reset() the hash and start a new hashing process.
Implements Hash.
Definition at line 118 of file BLAKE2s.cpp.