security: Reorganizing source code to prepare for support of two version of NDN certificates
This commit also removes unused ndn_digestSha256 function and deprecates
crypto::sha256 in favor of crypto::computeSha256Digest in util/crypto.hpp.
Change-Id: I24ee50ff073a96b868633bdf2cfade412d3605f3
Refs: #3098
diff --git a/src/util/crypto.hpp b/src/util/crypto.hpp
index dc0a754..e406006 100644
--- a/src/util/crypto.hpp
+++ b/src/util/crypto.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2013-2014 Regents of the University of California.
+ * Copyright (c) 2013-2016 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -26,17 +26,6 @@
#include "../encoding/buffer.hpp"
namespace ndn {
-
-/**
- * @brief Compute the sha-256 digest of data.
- *
- * @param data Pointer to the input byte array.
- * @param dataLength The length of data.
- * @param digest A pointer to a buffer of size crypto::SHA256_DIGEST_SIZE to receive the data.
- */
-void
-ndn_digestSha256(const uint8_t* data, size_t dataLength, uint8_t* digest);
-
namespace crypto {
/// @brief number of octets in a SHA256 digest
@@ -50,7 +39,18 @@
* @return A pointer to a buffer of SHA256_DIGEST.
*/
ConstBufferPtr
-sha256(const uint8_t* data, size_t dataLength);
+computeSha256Digest(const uint8_t* data, size_t dataLength);
+
+/**
+ * @brief Compute the sha-256 digest of data.
+ *
+ * @deprecated Use computeSha256Digest function instead
+ */
+inline ConstBufferPtr
+sha256(const uint8_t* data, size_t dataLength)
+{
+ return computeSha256Digest(data, dataLength);
+}
} // namespace crypto