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/tests/unit-tests/security/sec-tpm-file.t.cpp b/tests/unit-tests/security/sec-tpm-file.t.cpp
index ca73c70..56f8ba7 100644
--- a/tests/unit-tests/security/sec-tpm-file.t.cpp
+++ b/tests/unit-tests/security/sec-tpm-file.t.cpp
@@ -21,7 +21,7 @@
 
 #include "security/sec-tpm-file.hpp"
 #include "security/key-chain.hpp"
-#include "security/cryptopp.hpp"
+#include "security/v1/cryptopp.hpp"
 
 #include "util/time.hpp"
 
@@ -30,6 +30,7 @@
 #include "boost-test.hpp"
 
 namespace ndn {
+namespace security {
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(SecuritySecTpmFile)
@@ -67,7 +68,7 @@
   Block sigBlock;
   BOOST_CHECK_NO_THROW(sigBlock = tpm.signInTpm(content, sizeof(content),
                                                 keyName, DigestAlgorithm::SHA256));
-  shared_ptr<PublicKey> publicKey;
+  shared_ptr<v1::PublicKey> publicKey;
   BOOST_CHECK_NO_THROW(publicKey = tpm.getPublicKeyFromTpm(keyName));
 
   try
@@ -169,7 +170,7 @@
   BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), true);
   BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), true);
 
-  shared_ptr<PublicKey> publicKey;
+  shared_ptr<v1::PublicKey> publicKey;
   BOOST_CHECK_NO_THROW(publicKey = tpm.getPublicKeyFromTpm(keyName));
 
   const uint8_t content[] = {0x01, 0x02, 0x03, 0x04};
@@ -258,7 +259,7 @@
   BOOST_CHECK_NO_THROW(sigBlock = tpm.signInTpm(content, sizeof(content),
                                                 keyName, DigestAlgorithm::SHA256));
 
-  shared_ptr<PublicKey> pubkeyPtr;
+  shared_ptr<v1::PublicKey> pubkeyPtr;
   BOOST_CHECK_NO_THROW(pubkeyPtr = tpm.getPublicKeyFromTpm(keyName));
 
   try
@@ -320,7 +321,7 @@
   BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PRIVATE), true);
   BOOST_REQUIRE_EQUAL(tpm.doesKeyExistInTpm(keyName, KeyClass::PUBLIC), true);
 
-  shared_ptr<PublicKey> publicKey;
+  shared_ptr<v1::PublicKey> publicKey;
   BOOST_CHECK_NO_THROW(publicKey = tpm.getPublicKeyFromTpm(keyName));
 
   const uint8_t content[] = {0x01, 0x02, 0x03, 0x04};
@@ -406,4 +407,5 @@
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace tests
+} // namespace security
 } // namespace ndn