interest: Updating Interest::matchesData to use ImplicitSha256DigestComponent

Change-Id: I36660cdacb73efd7f724317b247c8a07578b6fdf
Refs: #1640
diff --git a/src/interest.cpp b/src/interest.cpp
index eb80c4b..304afcb 100644
--- a/src/interest.cpp
+++ b/src/interest.cpp
@@ -127,11 +127,8 @@
 
   // check prefix
   if (interestNameLength == fullNameLength) {
-    bool mightEndWithDigest = (interestNameLength > 0) &&
-                              (m_name.get(-1).value_size() == crypto::SHA256_DIGEST_SIZE);
-    if (mightEndWithDigest) {
-      // Interest Name is same length as Data full Name, last component could match digest
-      if (!m_name.isPrefixOf(data.getFullName()))
+    if (m_name.get(-1).isImplicitSha256Digest()) {
+      if (m_name != data.getFullName())
         return false;
     }
     else {