22 #ifndef NDN_UTIL_SHA256_HPP 23 #define NDN_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;
180 #endif // NDN_UTIL_SHA256_HPP
bool empty() const
Check if digest is empty.
Provides stateful SHA-256 digest calculation.
static const size_t DIGEST_SIZE
Length in bytes of a SHA-256 digest.
bool operator==(Sha256 &digest)
Check if the supplied digest is equal to this digest.
Represents a TLV element of NDN packet format.
std::string toString()
Convert digest to std::string.
Sha256()
Create an empty 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 not equal to this digest.
void reset()
Discard the current state and start a new digest calculation.
ConstBufferPtr computeDigest()
Finalize and return the digest based on all previously supplied inputs.
Sha256 & operator<<(Sha256 &src)
Add existing digest to the digest calculation.
shared_ptr< const Buffer > ConstBufferPtr