24 #include "ndn-cxx/security/impl/openssl.hpp"
44 namespace tr = security::transform;
52 namespace tr = security::transform;
54 m_input = make_unique<tr::StepSource>();
55 m_output = make_unique<OBufferStream>();
57 m_isFinalized =
false;
66 BOOST_ASSERT(m_input !=
nullptr);
71 return m_output->buf();
80 if (lhs.size() != rhs.size()) {
85 return CRYPTO_memcmp(lhs.data(), rhs.data(), lhs.size()) == 0;
92 update(buf->data(), buf->size());
99 update(
reinterpret_cast<const uint8_t*
>(str.data()), str.size());
113 update(
reinterpret_cast<const uint8_t*
>(&value),
sizeof(uint64_t));
123 BOOST_ASSERT(m_input !=
nullptr);
124 m_input->write({buffer, size});
139 sha256.
update(buffer, size);
Represents a TLV element of the NDN packet format.
const uint8_t * wire() const
Return a raw pointer to the beginning of the encoded wire.
size_t size() const
Return the size of the encoded wire, i.e.
General-purpose automatically managed/resized buffer.
implements an output stream that constructs ndn::Buffer
Provides stateful SHA-256 digest calculation.
ConstBufferPtr computeDigest()
Finalize and return the digest based on all previously supplied inputs.
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.
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.
void printHex(std::ostream &os, uint64_t num, bool wantUpperCase)
Output the hex representation of num to the output stream os.
std::string toHex(span< const uint8_t > buffer, bool wantUpperCase)
Return a string containing the hex representation of the bytes in buffer.
shared_ptr< const Buffer > ConstBufferPtr