diff --git a/ndn-cpp/c/encoding/binary-xml-data.c b/ndn-cpp/c/encoding/binary-xml-data.c
index 16a1497..de34f9d 100644
--- a/ndn-cpp/c/encoding/binary-xml-data.c
+++ b/ndn-cpp/c/encoding/binary-xml-data.c
@@ -173,7 +173,7 @@
 }
 
 ndn_Error ndn_encodeBinaryXmlData
-  (struct ndn_Data *data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset, struct ndn_BinaryXmlEncoder *encoder)
+  (struct ndn_Data *data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset, struct ndn_BinaryXmlEncoder *encoder)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_ContentObject)))
@@ -182,7 +182,7 @@
   if ((error = encodeSignature(&data->signature, encoder)))
     return error;
   
-  *signedFieldsBeginOffset = encoder->offset;
+  *signedPortionBeginOffset = encoder->offset;
 
   if ((error = ndn_encodeBinaryXmlName(&data->name, encoder)))
     return error;
@@ -194,7 +194,7 @@
       (encoder, ndn_BinaryXml_DTag_Content, data->content, data->contentLength)))
     return error;
 
-  *signedFieldsEndOffset = encoder->offset;
+  *signedPortionEndOffset = encoder->offset;
 
   if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
     return error;
@@ -203,7 +203,7 @@
 }
 
 ndn_Error ndn_decodeBinaryXmlData
-  (struct ndn_Data *data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset, struct ndn_BinaryXmlDecoder *decoder)
+  (struct ndn_Data *data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset, struct ndn_BinaryXmlDecoder *decoder)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_ContentObject)))
@@ -219,7 +219,7 @@
   else
     ndn_Signature_initialize(&data->signature, data->signature.keyLocator.keyName.components, data->signature.keyLocator.keyName.maxComponents);
   
-  *signedFieldsBeginOffset = decoder->offset;
+  *signedPortionBeginOffset = decoder->offset;
   
   if ((error = ndn_decodeBinaryXmlName(&data->name, decoder)))
     return error;
@@ -238,7 +238,7 @@
       (decoder, ndn_BinaryXml_DTag_Content, 1, &data->content, &data->contentLength)))
     return error; 
   
-  *signedFieldsEndOffset = decoder->offset;
+  *signedPortionEndOffset = decoder->offset;
 
   if ((error = ndn_BinaryXmlDecoder_readElementClose(decoder)))
     return error;
diff --git a/ndn-cpp/c/encoding/binary-xml-data.h b/ndn-cpp/c/encoding/binary-xml-data.h
index 3168cb1..caf9e35 100644
--- a/ndn-cpp/c/encoding/binary-xml-data.h
+++ b/ndn-cpp/c/encoding/binary-xml-data.h
@@ -19,28 +19,28 @@
 /**
  * Encode the data packet as binary XML.
  * @param data Pointer to the data object to encode.
- * @param signedFieldsBeginOffset Return the offset in the encoding of the beginning of the fields which are signed.
+ * @param signedPortionBeginOffset Return the offset in the encoding of the beginning of the signed portion.
  * If you are not encoding in order to sign, you can ignore this returned value.
- * @param signedFieldsEndOffset Return the offset in the encoding of the end of the fields which are signed.
+ * @param signedPortionEndOffset Return the offset in the encoding of the end of the signed portion.
  * If you are not encoding in order to sign, you can ignore this returned value.
  * @param encoder Pointer to the ndn_BinaryXmlEncoder struct which receives the encoding. 
  * @return 0 for success, else an error code.
  */
 ndn_Error ndn_encodeBinaryXmlData
-  (struct ndn_Data *data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset, struct ndn_BinaryXmlEncoder *encoder);
+  (struct ndn_Data *data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset, struct ndn_BinaryXmlEncoder *encoder);
 
 /**
  * Decode the data packet as binary XML and set the fields in the data object.
  * @param data Pointer to the data object whose fields are updated.
- * @param signedFieldsBeginOffset Return the offset in the input buffer of the beginning of the fields which are signed.
+ * @param signedPortionBeginOffset Return the offset in the input buffer of the beginning of the signed portion.
  * If you are not decoding in order to verify, you can ignore this returned value.
- * @param signedFieldsEndOffset Return the offset in the input buffer of the end of the fields which are signed.
+ * @param signedPortionEndOffset Return the offset in the input buffer of the end of the signed portion.
  * If you are not decoding in order to verify, you can ignore this returned value.
  * @param decoder Pointer to the ndn_BinaryXmlDecoder struct which has been initialized with the buffer to decode. 
  * @return 0 for success, else an error code.
  */
 ndn_Error ndn_decodeBinaryXmlData
-  (struct ndn_Data *data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset, struct ndn_BinaryXmlDecoder *decoder);
+  (struct ndn_Data *data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset, struct ndn_BinaryXmlDecoder *decoder);
 
 #ifdef __cplusplus
 }
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.cpp b/ndn-cpp/encoding/binary-xml-wire-format.cpp
index 55a6d77..930f89d 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.cpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.cpp
@@ -60,7 +60,7 @@
   interest.set(interestStruct);
 }
 
-Blob BinaryXmlWireFormat::encodeData(const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
+Blob BinaryXmlWireFormat::encodeData(const Data& data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset) 
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_NameComponent keyNameComponents[100];
@@ -72,14 +72,14 @@
 
   BinaryXmlEncoder encoder;
   ndn_Error error;
-  if ((error = ndn_encodeBinaryXmlData(&dataStruct, signedFieldsBeginOffset, signedFieldsEndOffset, &encoder)))
+  if ((error = ndn_encodeBinaryXmlData(&dataStruct, signedPortionBeginOffset, signedPortionEndOffset, &encoder)))
     throw std::runtime_error(ndn_getErrorString(error));
      
   return encoder.getOutput();
 }
 
 void BinaryXmlWireFormat::decodeData
-  (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset)
+  (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset)
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_NameComponent keyNameComponents[100];
@@ -90,7 +90,7 @@
     
   BinaryXmlDecoder decoder(input, inputLength);  
   ndn_Error error;
-  if ((error = ndn_decodeBinaryXmlData(&dataStruct, signedFieldsBeginOffset, signedFieldsEndOffset, &decoder)))
+  if ((error = ndn_decodeBinaryXmlData(&dataStruct, signedPortionBeginOffset, signedPortionEndOffset, &decoder)))
     throw std::runtime_error(ndn_getErrorString(error));
 
   data.set(dataStruct);
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.hpp b/ndn-cpp/encoding/binary-xml-wire-format.hpp
index 0f11aa4..ebb7412 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.hpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.hpp
@@ -35,29 +35,29 @@
   /**
    * Encode data with binary XML and return the encoding.
    * @param data The Data object to encode.
-   * @param signedFieldsBeginOffset Return the offset in the encoding of the beginning of the fields which are signed.
+   * @param signedPortionBeginOffset Return the offset in the encoding of the beginning of the signed portion.
    * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
-   * @param signedFieldsEndOffset Return the offset in the encoding of the end of the fields which are signed.
+   * @param signedPortionEndOffset Return the offset in the encoding of the end of the signed portion.
    * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
    * @return A Blob containing the encoding.
    */
   virtual Blob encodeData
-    (const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
+    (const Data& data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
   
   /**
    * Decode input as a data packet in binary XML and set the fields in the data object.
    * @param data The Data object whose fields are updated.
    * @param input A pointer to the input buffer to decode.
    * @param inputLength The number of bytes in input.
-   * @param signedFieldsBeginOffset Return the offset in the input buffer of the beginning of the fields which are signed.
+   * @param signedPortionBeginOffset Return the offset in the input buffer of the beginning of the signed portion.
    * If you are not decoding in order to verify, you can call 
    * decodeData(Data& data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
-   * @param signedFieldsEndOffset Return the offset in the input buffer of the end of the fields which are signed.
+   * @param signedPortionEndOffset Return the offset in the input buffer of the end of the signed portion.
    * If you are not decoding in order to verify, you can call 
    * decodeData(Data& data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
    */  
   virtual void decodeData
-    (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
+    (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
 
   /**
    * Encode forwardingEntry in binary XML and return the encoding. 
diff --git a/ndn-cpp/encoding/wire-format.cpp b/ndn-cpp/encoding/wire-format.cpp
index 450f3e0..fc39a7b 100644
--- a/ndn-cpp/encoding/wire-format.cpp
+++ b/ndn-cpp/encoding/wire-format.cpp
@@ -36,12 +36,12 @@
   throw logic_error("unimplemented");
 }
 
-Blob WireFormat::encodeData(const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
+Blob WireFormat::encodeData(const Data& data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset) 
 {
   throw logic_error("unimplemented");
 }
 void WireFormat::decodeData
-  (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset) 
+  (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset) 
 {
   throw logic_error("unimplemented");
 }
diff --git a/ndn-cpp/encoding/wire-format.hpp b/ndn-cpp/encoding/wire-format.hpp
index e6a19f5..a892659 100644
--- a/ndn-cpp/encoding/wire-format.hpp
+++ b/ndn-cpp/encoding/wire-format.hpp
@@ -38,15 +38,15 @@
   /**
    * Encode data and return the encoding.  Your derived class should override.
    * @param data The Data object to encode.
-   * @param signedFieldsBeginOffset Return the offset in the encoding of the beginning of the fields which are signed.
+   * @param signedPortionBeginOffset Return the offset in the encoding of the beginning of the signed portion.
    * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
-   * @param signedFieldsEndOffset Return the offset in the encoding of the end of the fields which are signed.
+   * @param signedPortionEndOffset Return the offset in the encoding of the end of the signed portion.
    * If you are not encoding in order to sign, you can call encodeData(const Data& data) to ignore this returned value.
    * @return A Blob containing the encoding.
    * @throw logic_error for unimplemented if the derived class does not override.
    */
   virtual Blob encodeData
-    (const Data& data, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
+    (const Data& data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
 
   /**
    * Encode data and return the encoding.
@@ -65,16 +65,16 @@
    * @param data The Data object whose fields are updated.
    * @param input A pointer to the input buffer to decode.
    * @param inputLength The number of bytes in input.
-   * @param signedFieldsBeginOffset Return the offset in the input buffer of the beginning of the fields which are signed.
+   * @param signedPortionBeginOffset Return the offset in the input buffer of the beginning of the signed portion.
    * If you are not decoding in order to verify, you can call 
    * decodeData(Data& data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
-   * @param signedFieldsEndOffset Return the offset in the input buffer of the end of the fields which are signed.
+   * @param signedPortionEndOffset Return the offset in the input buffer of the end of the signed portion.
    * If you are not decoding in order to verify, you can call 
    * decodeData(Data& data, const unsigned char *input, unsigned int inputLength) to ignore this returned value.
    * @throw logic_error for unimplemented if the derived class does not override.
    */  
   virtual void decodeData
-    (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedFieldsBeginOffset, unsigned int *signedFieldsEndOffset);
+    (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
 
   void decodeData(Data& data, const unsigned char *input, unsigned int inputLength)
   {
diff --git a/ndn-cpp/security/key-chain.cpp b/ndn-cpp/security/key-chain.cpp
index 8549f03..1a8d12b 100644
--- a/ndn-cpp/security/key-chain.cpp
+++ b/ndn-cpp/security/key-chain.cpp
@@ -62,16 +62,16 @@
 };
 
 /**
- * Encode the fields of the Data object and set digest to the sha-256 digest.
+ * Encode the fields of the Data object and set digest to the sha-256 digest of the signed portion.
  * @param data The Data object with the fields to digest.
  * @param digest A pointer to a buffer of size SHA256_DIGEST_LENGTH to receive the data.
  */
-static void digestDataFieldsSha256(const Data& data, WireFormat& wireFormat, unsigned char *digest)
+static void dataSignedPortionSha256(const Data& data, WireFormat& wireFormat, unsigned char *digest)
 {
-  unsigned int signedFieldsBeginOffset, signedFieldsEndOffset;
-  Blob encoding = wireFormat.encodeData(data, &signedFieldsBeginOffset, &signedFieldsEndOffset);
+  unsigned int signedPortionBeginOffset, signedPortionEndOffset;
+  Blob encoding = wireFormat.encodeData(data, &signedPortionBeginOffset, &signedPortionEndOffset);
   
-  ndn_digestSha256(encoding.buf() + signedFieldsBeginOffset, signedFieldsEndOffset - signedFieldsBeginOffset, digest);
+  ndn_digestSha256(encoding.buf() + signedPortionBeginOffset, signedPortionEndOffset - signedPortionBeginOffset, digest);
 }
 
 void KeyChain::sign
@@ -89,8 +89,8 @@
   signature->getKeyLocator().setKeyData(publicKeyDer, publicKeyDerLength);
 
   // Sign the fields.
-  unsigned char dataFieldsDigest[SHA256_DIGEST_LENGTH];
-  digestDataFieldsSha256(data, wireFormat, dataFieldsDigest);
+  unsigned char signedPortionDigest[SHA256_DIGEST_LENGTH];
+  dataSignedPortionSha256(data, wireFormat, signedPortionDigest);
   // TODO: use RSA_size to get the proper size of the signature buffer.
   unsigned char signatureBits[1000];
   unsigned int signatureBitsLength;
@@ -99,7 +99,7 @@
   RSA *privateKey = d2i_RSAPrivateKey(NULL, &derPointer, privateKeyDerLength);
   if (!privateKey)
     throw std::runtime_error("Error decoding private key in d2i_RSAPrivateKey");
-  int success = RSA_sign(NID_sha256, dataFieldsDigest, sizeof(dataFieldsDigest), signatureBits, &signatureBitsLength, privateKey);
+  int success = RSA_sign(NID_sha256, signedPortionDigest, sizeof(signedPortionDigest), signatureBits, &signatureBitsLength, privateKey);
   // Free the private key before checking for success.
   RSA_free(privateKey);
   if (!success)
@@ -117,8 +117,8 @@
 {
   // Decode the data packet and digest the data fields.
   Data data;
-  unsigned int signedFieldsBeginOffset, signedFieldsEndOffset;
-  wireFormat.decodeData(data, input, inputLength, &signedFieldsBeginOffset, &signedFieldsEndOffset);
+  unsigned int signedPortionBeginOffset, signedPortionEndOffset;
+  wireFormat.decodeData(data, input, inputLength, &signedPortionBeginOffset, &signedPortionEndOffset);
   Sha256WithRsaSignature *signature = dynamic_cast<Sha256WithRsaSignature*>(data.getSignature());
   if (!signature)
     throw std::runtime_error("signature is not Sha256WithRsaSignature");
@@ -126,8 +126,8 @@
   if (signature->getDigestAlgorithm().size() != 0)
     // TODO: Allow a non-default digest algorithm.
     throw std::runtime_error("Cannot verify a data packet with a non-default digest algorithm");
-  unsigned char dataFieldsDigest[SHA256_DIGEST_LENGTH];
-  ndn_digestSha256(input + signedFieldsBeginOffset, signedFieldsEndOffset - signedFieldsBeginOffset, dataFieldsDigest);
+  unsigned char signedPortionDigest[SHA256_DIGEST_LENGTH];
+  ndn_digestSha256(input + signedPortionBeginOffset, signedPortionEndOffset - signedPortionBeginOffset, signedPortionDigest);
   
   // Find the public key.
   const unsigned char *publicKeyDer;
@@ -140,14 +140,14 @@
     // Can't find a public key.
     return false;
 
-  // Verify the dataFieldsDigest.
+  // Verify the signedPortionDigest.
   // Use a temporary pointer since d2i updates it.
   const unsigned char *derPointer = publicKeyDer;
   RSA *publicKey = d2i_RSA_PUBKEY(NULL, &derPointer, publicKeyDerLength);
   if (!publicKey)
     throw std::runtime_error("Error decoding public key in d2i_RSAPublicKey");
   int success = RSA_verify
-    (NID_sha256, dataFieldsDigest, sizeof(dataFieldsDigest), (unsigned char *)signature->getSignature().buf(), 
+    (NID_sha256, signedPortionDigest, sizeof(signedPortionDigest), (unsigned char *)signature->getSignature().buf(), 
      signature->getSignature().size(), publicKey);
   // Free the public key before checking for success.
   RSA_free(publicKey);
