further update and rename files
Change-Id: Ie664c5b9e5a764b8706d21cc85b9cec8755dc380
diff --git a/tests/unit-tests/crypto-helper.t.cpp b/tests/unit-tests/crypto-helper.t.cpp
index 313969e..fe614cf 100644
--- a/tests/unit-tests/crypto-helper.t.cpp
+++ b/tests/unit-tests/crypto-helper.t.cpp
@@ -18,7 +18,7 @@
* See AUTHORS.md for complete list of ndncert authors and contributors.
*/
-#include "detail/crypto-helper.hpp"
+#include "protocol-detail/crypto-helper.hpp"
#include "test-common.hpp"
namespace ndn {
@@ -294,6 +294,19 @@
BOOST_CHECK(memcmp(decrypted, plaintext, sizeof(plaintext)) == 0);
}
+
+BOOST_AUTO_TEST_CASE(BlockEncodingDecoding)
+{
+ const uint8_t key[] = {0xbc, 0x22, 0xf3, 0xf0, 0x5c, 0xc4, 0x0d, 0xb9,
+ 0x31, 0x1e, 0x41, 0x92, 0x96, 0x6f, 0xee, 0x92};
+ const std::string plaintext = "alongstringalongstringalongstringalongstringalongstringalongstringalongstringalongstring";
+ const std::string associatedData = "test";
+ auto block = encodeBlockWithAesGcm128(ndn::tlv::Content, key, (uint8_t*)plaintext.c_str(), plaintext.size(),
+ (uint8_t*)associatedData.c_str(), associatedData.size());
+ auto decoded = decodeBlockWithAesGcm128(block, key, (uint8_t*)associatedData.c_str(), associatedData.size());
+ BOOST_CHECK_EQUAL(plaintext, std::string((char*)decoded.get<uint8_t>(), decoded.size()));
+}
+
BOOST_AUTO_TEST_SUITE_END()
} // namespace tests