22 #ifndef NDN_CRYPTOLITE_HPP
23 #define NDN_CRYPTOLITE_HPP
25 #include "blob-lite.hpp"
26 #include "../../c/errors.h"
43 digestSha256(
const uint8_t* data,
size_t dataLength, uint8_t *digest);
79 (
const uint8_t* key,
size_t keyLength,
const uint8_t* data,
size_t dataLength,
107 (
const uint8_t* signature,
size_t signatureLength,
const uint8_t *data,
size_t size() const
Return size given to the constructor.
Definition: blob-lite.hpp:61
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:36
CryptoLite has static methods for basic cryptography operations.
Definition: crypto-lite.hpp:33
static void digestSha256(const uint8_t *data, size_t dataLength, uint8_t *digest)
Compute the sha-256 digest of data.
Definition: crypto-lite.cpp:28
static bool verifyDigestSha256Signature(const uint8_t *signature, size_t signatureLength, const uint8_t *data, size_t dataLength)
Verify that the DigestSha256 of the data equals the signature.
Definition: crypto-lite.cpp:49
A BlobLite holds a pointer to an immutable pre-allocated buffer and its length This is like a JavaScr...
Definition: blob-lite.hpp:37
static bool verifyDigestSha256Signature(const BlobLite &signature, const BlobLite &data)
Verify that the DigestSha256 of the data equals the signature.
Definition: crypto-lite.hpp:117
const uint8_t * buf() const
Return buf given to the constructor.
Definition: blob-lite.hpp:55
static void digestSha256(const BlobLite &data, uint8_t *digest)
Compute the sha-256 digest of data.
Definition: crypto-lite.hpp:52
static ndn_Error generateRandomBytes(uint8_t *buffer, size_t bufferLength)
Fill the buffer with random bytes.
Definition: crypto-lite.cpp:34
static void computeHmacWithSha256(const uint8_t *key, size_t keyLength, const uint8_t *data, size_t dataLength, uint8_t *digest)
Compute the HMAC with sha-256 of data, as defined in http://tools.ietf.org/html/rfc2104#section-2 ...
Definition: crypto-lite.cpp:41