Jeff Thompson | 3af7e79 | 2013-08-23 14:22:11 -0700 | [diff] [blame] | 1 | /** |
Jeff Thompson | 7687dc0 | 2013-09-13 11:54:07 -0700 | [diff] [blame] | 2 | * Copyright (C) 2013 Regents of the University of California. |
| 3 | * @author: Jeff Thompson <jefft0@remap.ucla.edu> |
Jeff Thompson | 3af7e79 | 2013-08-23 14:22:11 -0700 | [diff] [blame] | 4 | * See COPYING for copyright and distribution information. |
| 5 | */ |
| 6 | |
Alexander Afanasyev | 09c613f | 2014-01-29 00:23:58 -0800 | [diff] [blame^] | 7 | #include "util/crypto.hpp" |
Alexander Afanasyev | d409d59 | 2014-01-28 18:36:38 -0800 | [diff] [blame] | 8 | |
| 9 | namespace ndn { |
Jeff Thompson | 3af7e79 | 2013-08-23 14:22:11 -0700 | [diff] [blame] | 10 | |
Jeff Thompson | 97223af | 2013-09-24 17:01:27 -0700 | [diff] [blame] | 11 | void ndn_digestSha256(const uint8_t *data, size_t dataLength, uint8_t *digest) |
Jeff Thompson | 3af7e79 | 2013-08-23 14:22:11 -0700 | [diff] [blame] | 12 | { |
| 13 | SHA256_CTX sha256; |
| 14 | SHA256_Init(&sha256); |
| 15 | SHA256_Update(&sha256, data, dataLength); |
| 16 | SHA256_Final(digest, &sha256); |
| 17 | } |
Alexander Afanasyev | d409d59 | 2014-01-28 18:36:38 -0800 | [diff] [blame] | 18 | |
| 19 | } // namespace ndn |