22 #ifndef NDN_UTIL_SHA256_HPP 23 #define NDN_UTIL_SHA256_HPP 25 #include "../encoding/block.hpp" 26 #include "../encoding/buffer-stream.hpp" 27 #include "../security/transform/step-source.hpp" 47 class Error :
public std::runtime_error
52 :
std::runtime_error(what)
110 return !(*
this == digest);
153 update(
const uint8_t* buffer,
size_t size);
172 unique_ptr<security::transform::StepSource> m_input;
173 unique_ptr<OBufferStream> m_output;
184 #endif // NDN_UTIL_SHA256_HPP Copyright (c) 2013-2017 Regents of the University of California.
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.
Error(const std::string &what)
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