22 #ifndef NDN_UTIL_DIGEST_HPP
23 #define NDN_UTIL_DIGEST_HPP
25 #include "../encoding/buffer.hpp"
26 #include "../encoding/block.hpp"
27 #include "../security/v1/cryptopp.hpp"
44 template<
typename Hash>
52 class Error :
public std::runtime_error
57 :
std::runtime_error(what)
85 return !m_isInProcess;
110 return !(*
this == digest);
122 operator<<(Digest<Hash>& src);
158 update(
const uint8_t* buffer,
size_t size);
193 template<
typename Hash>
195 operator<<(std::ostream& os, Digest<Hash>& digest);
205 #endif // NDN_UTIL_DIGEST_HPP
Copyright (c) 2013-2016 Regents of the University of California.
void reset()
Discard the current state and start a new digest calculation.
shared_ptr< Buffer > BufferPtr
bool operator!=(Digest< Hash > &digest)
Check if the supplied digest is not equal to this digest.
Class representing a wire element of NDN-TLV packet format.
provides a stateful digest calculation
bool empty() const
Check if digest is empty.
Digest< Hash > & operator<<(Digest< Hash > &src)
Add existing digest to the digest calculation.
Digest< CryptoPP::SHA256 > Sha256
A digest using SHA256 as the hash function.
Error(const std::string &what)
void update(const uint8_t *buffer, size_t size)
Add a buffer to the digest calculation.
ConstBufferPtr computeDigest()
Finalize and return the digest based on all previously supplied inputs.
bool operator==(Digest< Hash > &digest)
Check if the supplied digest equals to this digest.
shared_ptr< const Buffer > ConstBufferPtr
std::string toString()
Convert digest to std::string.
a concept check for CryptoPP hash algorithm