diff --git a/daemon/table/cs-entry.cpp b/daemon/table/cs-entry.cpp
index 447c710..1262065 100644
--- a/daemon/table/cs-entry.cpp
+++ b/daemon/table/cs-entry.cpp
@@ -1,11 +1,12 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014  Regents of the University of California,
- *                     Arizona Board of Regents,
- *                     Colorado State University,
- *                     University Pierre & Marie Curie, Sorbonne University,
- *                     Washington University in St. Louis,
- *                     Beijing Institute of Technology
+ * Copyright (c) 2014,  Regents of the University of California,
+ *                      Arizona Board of Regents,
+ *                      Colorado State University,
+ *                      University Pierre & Marie Curie, Sorbonne University,
+ *                      Washington University in St. Louis,
+ *                      Beijing Institute of Technology,
+ *                      The University of Memphis
  *
  * This file is part of NFD (Named Data Networking Forwarding Daemon).
  * See AUTHORS.md for complete list of NFD authors and contributors.
@@ -21,7 +22,9 @@
  * You should have received a copy of the GNU General Public License along with
  * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  *
- * \author Ilya Moiseenko <iliamo@ucla.edu>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
+ * \author Junxiao Shi <http://www.cs.arizona.edu/people/shijunxiao/>
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
  */
 
 #include "cs-entry.hpp"
@@ -38,8 +41,6 @@
   BOOST_ASSERT(m_layerIterators.empty());
 
   m_dataPacket.reset();
-  m_digest.reset();
-  m_nameWithDigest.clear();
 }
 
 void
@@ -47,24 +48,8 @@
 {
   m_isUnsolicited = isUnsolicited;
   m_dataPacket = data.shared_from_this();
-  m_digest.reset();
 
   updateStaleTime();
-
-  m_nameWithDigest = data.getName();
-  m_nameWithDigest.append(ndn::name::Component(getDigest()));
-}
-
-void
-Entry::setData(const Data& data, bool isUnsolicited, const ndn::ConstBufferPtr& digest)
-{
-  m_dataPacket = data.shared_from_this();
-  m_digest = digest;
-
-  updateStaleTime();
-
-  m_nameWithDigest = data.getName();
-  m_nameWithDigest.append(ndn::name::Component(getDigest()));
 }
 
 void
@@ -73,18 +58,6 @@
   m_staleAt = time::steady_clock::now() + m_dataPacket->getFreshnessPeriod();
 }
 
-const ndn::ConstBufferPtr&
-Entry::getDigest() const
-{
-  if (!static_cast<bool>(m_digest))
-    {
-      const Block& block = m_dataPacket->wireEncode();
-      m_digest = ndn::crypto::sha256(block.wire(), block.size());
-    }
-
-  return m_digest;
-}
-
 void
 Entry::setIterator(int layer, const Entry::LayerIterators::mapped_type& layerIterator)
 {
diff --git a/daemon/table/cs-entry.hpp b/daemon/table/cs-entry.hpp
index 2150b32..0373e60 100644
--- a/daemon/table/cs-entry.hpp
+++ b/daemon/table/cs-entry.hpp
@@ -1,11 +1,12 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014  Regents of the University of California,
- *                     Arizona Board of Regents,
- *                     Colorado State University,
- *                     University Pierre & Marie Curie, Sorbonne University,
- *                     Washington University in St. Louis,
- *                     Beijing Institute of Technology
+ * Copyright (c) 2014,  Regents of the University of California,
+ *                      Arizona Board of Regents,
+ *                      Colorado State University,
+ *                      University Pierre & Marie Curie, Sorbonne University,
+ *                      Washington University in St. Louis,
+ *                      Beijing Institute of Technology,
+ *                      The University of Memphis
  *
  * This file is part of NFD (Named Data Networking Forwarding Daemon).
  * See AUTHORS.md for complete list of NFD authors and contributors.
@@ -21,17 +22,17 @@
  * You should have received a copy of the GNU General Public License along with
  * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  *
- * \author Ilya Moiseenko <iliamo@ucla.edu>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
+ * \author Junxiao Shi <http://www.cs.arizona.edu/people/shijunxiao/>
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
  */
 
 #ifndef NFD_DAEMON_TABLE_CS_ENTRY_HPP
 #define NFD_DAEMON_TABLE_CS_ENTRY_HPP
 
 #include "common.hpp"
-#include <ndn-cxx/util/crypto.hpp>
 
 namespace nfd {
-
 namespace cs {
 
 class Entry;
@@ -56,6 +57,13 @@
   const Name&
   getName() const;
 
+  /** \brief returns the full name (including implicit digest) of the Data packet stored
+   *         in the CS entry
+   *  \return{ NDN name }
+   */
+  const Name&
+  getFullName() const;
+
   /** \brief Data packet is unsolicited if this particular NDN node
    *  did not receive an Interest packet for it, or the Interest packet has already expired
    *  \return{ True if the Data packet is unsolicited; otherwise False  }
@@ -79,22 +87,12 @@
   void
   setData(const Data& data, bool isUnsolicited);
 
-  /** \brief changes the content of CS entry and modifies digest
-   */
-  void
-  setData(const Data& data, bool isUnsolicited, const ndn::ConstBufferPtr& digest);
-
   /** \brief refreshes the time when Data becomes expired
    *  according to the current absolute time.
    */
   void
   updateStaleTime();
 
-  /** \brief returns the digest of the Data packet stored in the CS entry.
-   */
-  const ndn::ConstBufferPtr&
-  getDigest() const;
-
   /** \brief saves the iterator pointing to the CS entry on a specific layer of skip list
    */
   void
@@ -121,9 +119,6 @@
   shared_ptr<const Data> m_dataPacket;
 
   bool m_isUnsolicited;
-  Name m_nameWithDigest;
-
-  mutable ndn::ConstBufferPtr m_digest;
 
   LayerIterators m_layerIterators;
 };
@@ -136,7 +131,13 @@
 inline const Name&
 Entry::getName() const
 {
-  return m_nameWithDigest;
+  return m_dataPacket->getName();
+}
+
+inline const Name&
+Entry::getFullName() const
+{
+  return m_dataPacket->getFullName();
 }
 
 inline const Data&
diff --git a/daemon/table/cs.cpp b/daemon/table/cs.cpp
index f1bbb0f..2c1b657 100644
--- a/daemon/table/cs.cpp
+++ b/daemon/table/cs.cpp
@@ -22,14 +22,18 @@
  * You should have received a copy of the GNU General Public License along with
  * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  *
- * \author Ilya Moiseenko <iliamo@ucla.edu>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
+ * \author Junxiao Shi <http://www.cs.arizona.edu/people/shijunxiao/>
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
  */
 
 #include "cs.hpp"
 #include "core/logger.hpp"
 #include "core/random.hpp"
+
 #include <ndn-cxx/util/crypto.hpp>
 #include <ndn-cxx/security/signature-sha256-with-rsa.hpp>
+
 #include <boost/random/bernoulli_distribution.hpp>
 
 /// max skip list layers
@@ -106,7 +110,7 @@
 std::pair<cs::Entry*, bool>
 Cs::insertToSkipList(const Data& data, bool isUnsolicited)
 {
-  NFD_LOG_TRACE("insertToSkipList() " << data.getName() << ", "
+  NFD_LOG_TRACE("insertToSkipList() " << data.getFullName() << ", "
                 << "skipList size " << size());
 
   BOOST_ASSERT(m_cleanupIndex.size() <= size());
@@ -139,7 +143,7 @@
           if (head != (*rit)->end())
             {
               // it can happen when begin() contains the element in front of which we need to insert
-              if (!isIterated && ((*head)->getName() >= entry->getName()))
+              if (!isIterated && ((*head)->getFullName() >= entry->getFullName()))
                 {
                   --updateTable[layer];
                   insertInFront = true;
@@ -148,7 +152,7 @@
                 {
                   SkipListLayer::iterator it = head;
 
-                  while ((*it)->getName() < entry->getName())
+                  while ((*it)->getFullName() < entry->getFullName())
                     {
                       head = it;
                       updateTable[layer] = it;
@@ -180,7 +184,7 @@
   bool isNameIdentical = false;
   if (!isCsEmpty && isInBoundaries)
     {
-      isNameIdentical = (*head)->getName() == entry->getName();
+      isNameIdentical = (*head)->getFullName() == entry->getFullName();
     }
 
   //check if this is a duplicate packet
@@ -188,7 +192,7 @@
     {
       NFD_LOG_TRACE("Duplicate name (with digest)");
 
-      (*head)->setData(data, isUnsolicited, entry->getDigest()); //updates stale time
+      (*head)->setData(data, isUnsolicited); //updates stale time
 
       // new entry not needed, returning to the pool
       entry->release();
@@ -246,7 +250,7 @@
 bool
 Cs::insert(const Data& data, bool isUnsolicited)
 {
-  NFD_LOG_TRACE("insert() " << data.getName());
+  NFD_LOG_TRACE("insert() " << data.getFullName());
 
   if (isFull())
     {
@@ -292,7 +296,7 @@
 bool
 Cs::eraseFromSkipList(cs::Entry* entry)
 {
-  NFD_LOG_TRACE("eraseFromSkipList() "  << entry->getName());
+  NFD_LOG_TRACE("eraseFromSkipList() "  << entry->getFullName());
   NFD_LOG_TRACE("SkipList size " << size());
 
   bool isErased = false;
@@ -399,7 +403,7 @@
           if (head != (*rit)->end())
             {
               // it happens when begin() contains the element we want to find
-              if (!isIterated && (interest.getName().isPrefixOf((*head)->getName())))
+              if (!isIterated && (interest.getName().isPrefixOf((*head)->getFullName())))
                 {
                   if (layer > 0)
                     {
@@ -415,9 +419,9 @@
                 {
                   SkipListLayer::iterator it = head;
 
-                  while ((*it)->getName() < interest.getName())
+                  while ((*it)->getFullName() < interest.getName())
                     {
-                      NFD_LOG_TRACE((*it)->getName() << " < " << interest.getName());
+                      NFD_LOG_TRACE((*it)->getFullName() << " < " << interest.getName());
                       head = it;
                       isIterated = true;
 
@@ -452,11 +456,11 @@
 
   if (startingPoint != (*m_skipList.begin())->begin())
     {
-      BOOST_ASSERT((*startingPoint)->getName() < interest.getName());
+      BOOST_ASSERT((*startingPoint)->getFullName() < interest.getName());
     }
 
   NFD_LOG_TRACE("selectChild() " << interest.getChildSelector() << " "
-                << (*startingPoint)->getName());
+                << (*startingPoint)->getFullName());
 
   bool hasLeftmostSelector = (interest.getChildSelector() <= 0);
   bool hasRightmostSelector = !hasLeftmostSelector;
@@ -468,11 +472,11 @@
 
       if (doesInterestContainDigest)
         {
-          isInPrefix = interest.getName().getPrefix(-1).isPrefixOf((*startingPoint)->getName());
+          isInPrefix = interest.getName().getPrefix(-1).isPrefixOf((*startingPoint)->getFullName());
         }
       else
         {
-          isInPrefix = interest.getName().isPrefixOf((*startingPoint)->getName());
+          isInPrefix = interest.getName().isPrefixOf((*startingPoint)->getFullName());
         }
 
       if (isInPrefix)
@@ -506,11 +510,11 @@
               if (doesInterestContainDigest)
                 {
                   isInPrefix = interest.getName().getPrefix(-1)
-                                 .isPrefixOf((*rightmostCandidate)->getName());
+                                 .isPrefixOf((*rightmostCandidate)->getFullName());
                 }
               else
                 {
-                  isInPrefix = interest.getName().isPrefixOf((*rightmostCandidate)->getName());
+                  isInPrefix = interest.getName().isPrefixOf((*rightmostCandidate)->getFullName());
                 }
             }
 
@@ -529,7 +533,7 @@
                         {
                           // get prefix which is one component longer than Interest name
                           // (without digest)
-                          const Name& childPrefix = (*rightmostCandidate)->getName()
+                          const Name& childPrefix = (*rightmostCandidate)->getFullName()
                                                       .getPrefix(interest.getName().size());
                           NFD_LOG_TRACE("Child prefix" << childPrefix);
 
@@ -542,7 +546,7 @@
                       else
                         {
                           // get prefix which is one component longer than Interest name
-                          const Name& childPrefix = (*rightmostCandidate)->getName()
+                          const Name& childPrefix = (*rightmostCandidate)->getFullName()
                                                       .getPrefix(interest.getName().size() + 1);
                           NFD_LOG_TRACE("Child prefix" << childPrefix);
 
@@ -572,11 +576,11 @@
 
       if (doesInterestContainDigest)
         {
-          isInPrefix = interest.getName().getPrefix(-1).isPrefixOf((*startingPoint)->getName());
+          isInPrefix = interest.getName().getPrefix(-1).isPrefixOf((*startingPoint)->getFullName());
         }
       else
         {
-          isInPrefix = interest.getName().isPrefixOf((*startingPoint)->getName());
+          isInPrefix = interest.getName().isPrefixOf((*startingPoint)->getFullName());
         }
 
       if (isInPrefix)
@@ -599,19 +603,14 @@
   NFD_LOG_TRACE("doesComplyWithSelectors()");
 
   /// \todo The following detection is not correct
-  ///       1. If data name ends with 32-octet component doesn't mean that this component is digest
+  ///       1. If Interest name ends with 32-octet component doesn't mean that this component is
+  ///          digest
   ///       2. Only min/max selectors (both 0) can be specified, all other selectors do not
   ///          make sense for interests with digest (though not sure if we need to enforce this)
 
   if (doesInterestContainDigest)
     {
-      const ndn::name::Component& last = interest.getName().get(-1);
-      const ndn::ConstBufferPtr& digest = entry->getDigest();
-
-      BOOST_ASSERT(digest->size() == last.value_size());
-      BOOST_ASSERT(digest->size() == ndn::crypto::SHA256_DIGEST_SIZE);
-
-      if (std::memcmp(digest->buf(), last.value(), ndn::crypto::SHA256_DIGEST_SIZE) != 0)
+      if (interest.getName().get(-1) != entry->getFullName().get(-1))
         {
           NFD_LOG_TRACE("violates implicit digest");
           return false;
@@ -624,7 +623,7 @@
         {
           size_t minDataNameLength = interest.getName().size() + interest.getMinSuffixComponents();
 
-          bool isSatisfied = (minDataNameLength <= entry->getName().size());
+          bool isSatisfied = (minDataNameLength <= entry->getFullName().size());
           if (!isSatisfied)
             {
               NFD_LOG_TRACE("violates minComponents");
@@ -636,7 +635,7 @@
         {
           size_t maxDataNameLength = interest.getName().size() + interest.getMaxSuffixComponents();
 
-          bool isSatisfied = (maxDataNameLength >= entry->getName().size());
+          bool isSatisfied = (maxDataNameLength >= entry->getFullName().size());
           if (!isSatisfied)
             {
               NFD_LOG_TRACE("violates maxComponents");
@@ -671,7 +670,7 @@
 
   if (doesInterestContainDigest)
     {
-      const ndn::name::Component& lastComponent = entry->getName().get(-1);
+      const ndn::name::Component& lastComponent = entry->getFullName().get(-1);
 
       if (!lastComponent.empty())
         {
@@ -684,9 +683,9 @@
     }
   else
     {
-      if (entry->getName().size() >= interest.getName().size() + 1)
+      if (entry->getFullName().size() >= interest.getName().size() + 1)
         {
-          const ndn::name::Component& nextComponent = entry->getName()
+          const ndn::name::Component& nextComponent = entry->getFullName()
                                                         .get(interest.getName().size());
           if (!nextComponent.empty())
             {
@@ -709,7 +708,7 @@
   // only when min selector is not specified or specified with value of 0
   // and Interest's name length is exactly the length of the name of CS entry
   if (interest.getMinSuffixComponents() <= 0 &&
-      interest.getName().size() == (entry->getName().size()))
+      interest.getName().size() == (entry->getFullName().size()))
     {
       const ndn::name::Component& last = interest.getName().get(-1);
       if (last.value_size() == ndn::crypto::SHA256_DIGEST_SIZE)
@@ -748,7 +747,7 @@
           if (head != (*rit)->end())
             {
               // it can happen when begin() contains the element we want to remove
-              if (!isIterated && ((*head)->getName() == exactName))
+              if (!isIterated && ((*head)->getFullName() == exactName))
                 {
                   eraseFromSkipList(*head);
                   return;
@@ -757,7 +756,7 @@
                 {
                   SkipListLayer::iterator it = head;
 
-                  while ((*it)->getName() < exactName)
+                  while ((*it)->getFullName() < exactName)
                     {
                       head = it;
                       updateTable[layer] = it;
@@ -789,13 +788,13 @@
   bool isNameIdentical = false;
   if (!isCsEmpty && isInBoundaries)
     {
-      NFD_LOG_TRACE("Identical? " << (*head)->getName());
-      isNameIdentical = (*head)->getName() == exactName;
+      NFD_LOG_TRACE("Identical? " << (*head)->getFullName());
+      isNameIdentical = (*head)->getFullName() == exactName;
     }
 
   if (isNameIdentical)
     {
-      NFD_LOG_TRACE("Found target " << (*head)->getName());
+      NFD_LOG_TRACE("Found target " << (*head)->getFullName());
       eraseFromSkipList(*head);
     }
 }
@@ -810,7 +809,7 @@
     {
       for (SkipListLayer::iterator it = (*rit)->begin(); it != (*rit)->end(); ++it)
         {
-          NFD_LOG_TRACE("Layer " << layer << " " << (*it)->getName());
+          NFD_LOG_TRACE("Layer " << layer << " " << (*it)->getFullName());
         }
       layer--;
     }
diff --git a/daemon/table/cs.hpp b/daemon/table/cs.hpp
index c523293..67cc611 100644
--- a/daemon/table/cs.hpp
+++ b/daemon/table/cs.hpp
@@ -22,7 +22,9 @@
  * You should have received a copy of the GNU General Public License along with
  * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  *
- * \author Ilya Moiseenko <iliamo@ucla.edu>
+ * \author Ilya Moiseenko <http://ilyamoiseenko.com/>
+ * \author Junxiao Shi <http://www.cs.arizona.edu/people/shijunxiao/>
+ * \author Alexander Afanasyev <http://lasr.cs.ucla.edu/afanasyev/index.html>
  */
 
 #ifndef NFD_DAEMON_TABLE_CS_HPP
diff --git a/tests/daemon/table/cs.cpp b/tests/daemon/table/cs.cpp
index 3e41781..3592290 100644
--- a/tests/daemon/table/cs.cpp
+++ b/tests/daemon/table/cs.cpp
@@ -165,11 +165,13 @@
   Name name2("/insert/fresh");
   shared_ptr<Data> data2 = makeData(name2);
   data2->setFreshnessPeriod(time::milliseconds(5000));
+  signData(data2);
   cs.insert(*data2);
 
   Name name("/insert/expire");
   shared_ptr<Data> data = makeData(name);
   data->setFreshnessPeriod(time::milliseconds(500));
+  signData(data);
   cs.insert(*data);
 
   BOOST_CHECK_EQUAL(cs.size(), 2);
@@ -264,7 +266,8 @@
   entry->setData(*data, false);
 
   BOOST_CHECK_EQUAL_COLLECTIONS(digest1->begin(), digest1->end(),
-                                entry->getDigest()->begin(), entry->getDigest()->end());
+                                entry->getFullName()[-1].value_begin(),
+                                entry->getFullName()[-1].value_end());
 }
 
 BOOST_AUTO_TEST_CASE(InsertCanonical)
@@ -429,6 +432,7 @@
   Name name("/insert/nonfresh");
   shared_ptr<Data> data = makeData(name);
   data->setFreshnessPeriod(time::milliseconds(500));
+  signData(data);
   cs.insert(*data);
 
   sleep(1);
@@ -477,6 +481,7 @@
 
   fakeSignature.setKeyLocator(locator);
   data2->setSignature(fakeSignature);
+  data2->wireEncode();
 
   cs.insert(*data2);
 
@@ -602,6 +607,7 @@
     shared_ptr<Data> data = makeData(name);
     data->setFreshnessPeriod(time::milliseconds(99999));
     data->setContent(reinterpret_cast<const uint8_t*>(&id), sizeof(id));
+    signData(data);
 
     m_cs.insert(*data);
   }
diff --git a/tests/test-common.hpp b/tests/test-common.hpp
index 6b67f2f..9c60c77 100644
--- a/tests/test-common.hpp
+++ b/tests/test-common.hpp
@@ -67,10 +67,8 @@
 }
 
 inline shared_ptr<Data>
-makeData(const Name& name)
+signData(const shared_ptr<Data>& data)
 {
-  shared_ptr<Data> data = make_shared<Data>(name);
-
   ndn::SignatureSha256WithRsa fakeSignature;
   fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue,
                                         reinterpret_cast<const uint8_t*>(0), 0));
@@ -80,6 +78,15 @@
   return data;
 }
 
+inline shared_ptr<Data>
+makeData(const Name& name)
+{
+  shared_ptr<Data> data = make_shared<Data>(name);
+
+  return signData(data);
+}
+
+
 } // namespace tests
 } // namespace nfd
 
