6 #include "../common.hpp"
9 #include "../security/cryptopp.hpp"
17 using namespace CryptoPP;
19 CryptoPP::SHA256 hash;
23 catch (CryptoPP::Exception& e)
33 sha256(
const uint8_t* data,
size_t dataLength)
37 using namespace CryptoPP;
41 StringSource(data, dataLength,
true,
new HashFilter(hash,
new FileSink(os)));
44 catch (CryptoPP::Exception& e)
Class implementing interface similar to ostringstream, but to construct ndn::Buffer.
void ndn_digestSha256(const uint8_t *data, size_t dataLength, uint8_t *digest)
Compute the sha-256 digest of data.
static const size_t SHA256_DIGEST_SIZE
number of octets in a SHA256 digest
ptr_lib::shared_ptr< const Buffer > ConstBufferPtr
ConstBufferPtr sha256(const uint8_t *data, size_t dataLength)
Compute the sha-256 digest of data.