emsha 1.1.1
A compact HMAC-SHA-256 C++11 library.
|
#include <emsha.h>
Public Member Functions | |
virtual | ~Hash ()=default |
virtual EMSHAResult | Reset ()=0 |
Bring the Hash back to its initial state. More... | |
virtual EMSHAResult | Update (const std::uint8_t *message, std::uint32_t messageLength)=0 |
Write message data into the Hash. More... | |
virtual EMSHAResult | Finalise (std::uint8_t *digest)=0 |
Carry out any final operations on the Hash. More... | |
virtual EMSHAResult | Result (std::uint8_t *digest)=0 |
Result transfers out the hash to the argument. More... | |
virtual std::uint32_t | Size ()=0 |
Return the output size of the Hash. More... | |
A Hash is an abstract base class supporting concrete classes that produce digests of data.
|
virtualdefault |
|
pure virtual |
Carry out any final operations on the Hash.
After a call to finalize, no more data can be written. Additionally, it transfers out the resulting hash into its argument.
digest | The buffer to store the hash in. |
Implemented in emsha::HMAC, and emsha::SHA256.
|
pure virtual |
Bring the Hash back to its initial state.
That is, the idea is that
is idempotent, assuming the inputs to update and result are constant. The implications of this for a given concrete class should be described in that class's documentation, but in general, it has the effect of preserving any initial state while removing any data written to the Hash via the update method.
Implemented in emsha::HMAC, and emsha::SHA256.
|
pure virtual |
Result transfers out the hash to the argument.
The Hash must keep enough state for repeated calls to result to work.
digest | The buffer to store the hash in. |
Implemented in emsha::HMAC, and emsha::SHA256.
|
pure virtual |
Return the output size of the Hash.
This is how large the buffers written to by result should be.
Implemented in emsha::HMAC, and emsha::SHA256.
|
pure virtual |
Write message data into the Hash.
message | The message data to write into the Hash. |
messageLength | The length of the message data. |
Implemented in emsha::HMAC, and emsha::SHA256.