22 #ifndef NDN_CXX_UTIL_SHA256_HPP
23 #define NDN_CXX_UTIL_SHA256_HPP
47 class Error :
public std::runtime_error
50 using std::runtime_error::runtime_error;
106 return !(*
this == digest);
149 update(
const uint8_t* buffer,
size_t size);
168 unique_ptr<security::transform::StepSource> m_input;
169 unique_ptr<OBufferStream> m_output;
Represents a TLV element of the NDN packet format.
Provides stateful SHA-256 digest calculation.
ConstBufferPtr computeDigest()
Finalize and return the digest based on all previously supplied inputs.
bool empty() const
Check if digest is empty.
Sha256()
Create an empty SHA-256 digest.
static const size_t DIGEST_SIZE
Length in bytes of a SHA-256 digest.
void update(const uint8_t *buffer, size_t size)
Add a raw buffer to the digest calculation.
bool operator==(Sha256 &digest)
Check if the supplied digest is equal to this digest.
Sha256 & operator<<(Sha256 &src)
Add existing digest to the digest calculation.
bool operator!=(Sha256 &digest)
Check if the supplied digest is not equal to this digest.
std::string toString()
Convert digest to std::string.
void reset()
Discard the current state and start a new digest calculation.
std::ostream & operator<<(std::ostream &os, LogLevel level)
Output LogLevel as a string.
shared_ptr< const Buffer > ConstBufferPtr