address comments from Davide

Change-Id: I493fc14920bdec2241b2c77dd0ec73f4466b6129
diff --git a/src/detail/crypto-helpers.cpp b/src/detail/crypto-helpers.cpp
index c62db20..d72d7bf 100644
--- a/src/detail/crypto-helpers.cpp
+++ b/src/detail/crypto-helpers.cpp
@@ -21,6 +21,7 @@
 #include "detail/crypto-helpers.hpp"
 
 #include <boost/endian/conversion.hpp>
+#include <cstring>
 #include <ndn-cxx/encoding/buffer-stream.hpp>
 #include <ndn-cxx/security/transform/base64-decode.hpp>
 #include <ndn-cxx/security/transform/base64-encode.hpp>
@@ -342,7 +343,7 @@
   std::memcpy(&iv[8], reinterpret_cast<const uint8_t*>(&temp), 4);
   uint32_t increment = (payloadSize + 15) / 16;
   if (std::numeric_limits<uint32_t>::max() - counter < increment) {
-    NDN_THROW(std::runtime_error("Error incrementing the AES block counter:"
+    NDN_THROW(std::runtime_error("Error incrementing the AES block counter: "
                                  "too many blocks have been encrypted for the same request instance"));
   }
   else {
@@ -369,13 +370,15 @@
   // The spec of AES encrypted payload TLV used in NDNCERT:
   //   https://github.com/named-data/ndncert/wiki/NDNCERT-Protocol-0.3#242-aes-gcm-encryption
   block.parse();
-  Buffer result(block.get(tlv::EncryptedPayload).value_size());
-  auto resultLen = aesGcm128Decrypt(block.get(tlv::EncryptedPayload).value(),
-                                    block.get(tlv::EncryptedPayload).value_size(),
+  const auto& encryptedPayloadBlock = block.get(tlv::EncryptedPayload);
+  Buffer result(encryptedPayloadBlock.value_size());
+  auto resultLen = aesGcm128Decrypt(encryptedPayloadBlock.value(), encryptedPayloadBlock.value_size(),
                                     associatedData, associatedDataSize, block.get(tlv::AuthenticationTag).value(),
                                     key, block.get(tlv::InitializationVector).value(), result.data());
-  if (resultLen != block.get(tlv::EncryptedPayload).value_size()) {
+  if (resultLen != encryptedPayloadBlock.value_size()) {
     return Buffer();
+    NDN_THROW(std::runtime_error("Error when decrypting the AES Encrypted Block: "
+                                 "Decrypted payload is of an unexpected size"));
   }
   return result;
 }
diff --git a/src/detail/ndncert-common.hpp b/src/detail/ndncert-common.hpp
index d458147..77f6ca2 100644
--- a/src/detail/ndncert-common.hpp
+++ b/src/detail/ndncert-common.hpp
@@ -18,8 +18,8 @@
  * See AUTHORS.md for complete list of ndncert authors and contributors.
  */
 
-#ifndef NDNCERT_NDNCERT_COMMON_HPP
-#define NDNCERT_NDNCERT_COMMON_HPP
+#ifndef NDNCERT_DETAIL_NDNCERT_COMMON_HPP
+#define NDNCERT_DETAIL_NDNCERT_COMMON_HPP
 
 #include "detail/ndncert-config.hpp"
 
@@ -37,19 +37,18 @@
 
 #include <cstddef>
 #include <cstdint>
-#include <tuple>
-#include <ndn-cxx/encoding/tlv.hpp>
 #include <ndn-cxx/data.hpp>
-#include <ndn-cxx/encoding/block.hpp>
 #include <ndn-cxx/encoding/block-helpers.hpp>
+#include <ndn-cxx/encoding/block.hpp>
+#include <ndn-cxx/encoding/tlv.hpp>
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/interest.hpp>
-#include <ndn-cxx/link.hpp>
 #include <ndn-cxx/lp/nack.hpp>
 #include <ndn-cxx/name.hpp>
-#include <ndn-cxx/security/key-chain.hpp>
 #include <ndn-cxx/security/certificate.hpp>
+#include <ndn-cxx/security/key-chain.hpp>
 #include <ndn-cxx/util/logger.hpp>
+#include <tuple>
 #include <boost/algorithm/string.hpp>
 #include <boost/assert.hpp>
 #include <boost/noncopyable.hpp>
@@ -129,4 +128,4 @@
 } // namespace ndncert
 } // namespace ndn
 
-#endif // NDNCERT_NDNCERT_COMMON_HPP
+#endif // NDNCERT_DETAIL_NDNCERT_COMMON_HPP
diff --git a/src/identity-challenge/challenge-credential.cpp b/src/identity-challenge/challenge-credential.cpp
index 5ec176b..9cceefe 100644
--- a/src/identity-challenge/challenge-credential.cpp
+++ b/src/identity-challenge/challenge-credential.cpp
@@ -18,7 +18,6 @@
  */
 
 #include "challenge-credential.hpp"
-#include <iostream>
 #include <ndn-cxx/security/verification-helpers.hpp>
 #include <ndn-cxx/security/signing-helpers.hpp>
 #include <ndn-cxx/security/transform/public-key.hpp>