30 #ifndef EMSHA_SHA256_H
31 #define EMSHA_SHA256_H
152 std::array<uint8_t, SHA256_MB_SIZE> mb;
155 inline void updateMessageBlock(
void);
156 inline void padMessage(uint8_t pc);
157 uint32_t chunkToUint32(uint32_t offset);
158 uint32_t uint32ToChunk(uint32_t offset);
EMSHAResult Update(const std::uint8_t *message, std::uint32_t messageLength) override
Writes data into the SHA256.
SHA256()
A SHA256 context does not need any special construction.
EMSHAResult Finalise(std::uint8_t *digest) override
Complete the digest.
EMSHAResult Result(std::uint8_t *digest) override
Copy the result from the SHA-256 context into the buffer pointed to by d, running Finalise if needed....
EMSHAResult Reset() override
Clear the internal state of the SHA256 context, returning it to its initial state.
std::uint32_t Size() override
Returns the output size of SHA-256.
Declares an interface for an EMbedded Secure HAshing interface.
EMSHAResult SHA256SelfTest()
SHA256SelfTest runs through two test cases to ensure that the SHA-256 functions are working correctly...
const uint32_t SHA256_MB_SIZE
SHA256_MB_SIZE is the size of a message block.
Definition: sha256.h:44
EMSHAResult
Describe the result of an EMSHA operation.
Definition: emsha.h:64
EMSHAResult SHA256Digest(const uint8_t *m, uint32_t ml, uint8_t *d)
SHA256Digest performs a single pass hashing of the message passed in.