blob: 490feb800c055c28fe7d1264c6ba0ccfdc210bbf [file] [log] [blame]
Jeff Thompson3af7e792013-08-23 14:22:11 -07001/**
Jeff Thompson7687dc02013-09-13 11:54:07 -07002 * Copyright (C) 2013 Regents of the University of California.
3 * @author: Jeff Thompson <jefft0@remap.ucla.edu>
Jeff Thompson3af7e792013-08-23 14:22:11 -07004 * See COPYING for copyright and distribution information.
5 */
6
Alexander Afanasyev09c613f2014-01-29 00:23:58 -08007#include "util/crypto.hpp"
Alexander Afanasyevd409d592014-01-28 18:36:38 -08008
9namespace ndn {
Jeff Thompson3af7e792013-08-23 14:22:11 -070010
Jeff Thompson97223af2013-09-24 17:01:27 -070011void ndn_digestSha256(const uint8_t *data, size_t dataLength, uint8_t *digest)
Jeff Thompson3af7e792013-08-23 14:22:11 -070012{
13 SHA256_CTX sha256;
14 SHA256_Init(&sha256);
15 SHA256_Update(&sha256, data, dataLength);
16 SHA256_Final(digest, &sha256);
17}
Alexander Afanasyevd409d592014-01-28 18:36:38 -080018
19} // namespace ndn