Abstract base class for cryptographic hash algorithms.
More...
#include <Hash.h>
|
| Hash () |
| Constructs a new hash object.
|
|
virtual | ~Hash () |
| Destroys this hash object. More...
|
|
virtual size_t | hashSize () const =0 |
| Size of the hash result from finalize(). More...
|
|
virtual size_t | blockSize () const =0 |
| Size of the internal block used by the hash algorithm. More...
|
|
virtual void | reset ()=0 |
| Resets the hash ready for a new hashing process. More...
|
|
virtual void | update (const void *data, size_t len)=0 |
| Updates the hash with more data. More...
|
|
virtual void | finalize (void *hash, size_t len)=0 |
| Finalizes the hashing process and returns the hash. More...
|
|
virtual void | clear ()=0 |
| Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process. More...
|
|
Abstract base class for cryptographic hash algorithms.
- See Also
- SHA1, SHA256
Definition at line 29 of file Hash.h.
Destroys this hash object.
- Note
- Subclasses are responsible for clearing any sensitive data that remains in the hash object when it is destroyed.
- See Also
- clear()
Definition at line 47 of file Hash.cpp.
size_t Hash::blockSize |
( |
| ) |
const |
|
pure virtual |
Clears the hash state, removing all sensitive data, and then resets the hash ready for a new hashing process.
- See Also
- reset()
Implemented in BLAKE2s, SHA1, and SHA256.
void Hash::finalize |
( |
void * |
hash, |
|
|
size_t |
len |
|
) |
| |
|
pure virtual |
Finalizes the hashing process and returns the hash.
- Parameters
-
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().
- See Also
- reset(), update()
Implemented in BLAKE2s, SHA1, and SHA256.
size_t Hash::hashSize |
( |
| ) |
const |
|
pure virtual |
void Hash::update |
( |
const void * |
data, |
|
|
size_t |
len |
|
) |
| |
|
pure virtual |
The documentation for this class was generated from the following files: