diff --git a/ndn-cpp/security/key-chain.cpp b/ndn-cpp/security/key-chain.cpp
index 65d61bb..9ba15f0 100644
--- a/ndn-cpp/security/key-chain.cpp
+++ b/ndn-cpp/security/key-chain.cpp
@@ -65,7 +65,7 @@
  * @param dataLength
  * @param digest
  */
-void setSha256(const unsigned char *data, unsigned int dataLength, vector<unsigned char> &digest)
+void setSha256(const unsigned char *data, unsigned int dataLength, vector<unsigned char>& digest)
 {
   unsigned char digestBuffer[SHA256_DIGEST_LENGTH];
   ndn_digestSha256(data, dataLength, digestBuffer);
@@ -77,7 +77,7 @@
  * @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 digestDataFieldsSha256(const Data& data, WireFormat& wireFormat, unsigned char *digest)
 {
   unsigned int signedFieldsBeginOffset, signedFieldsEndOffset;
   ptr_lib::shared_ptr<vector<unsigned char> > encoding = wireFormat.encodeData(data, &signedFieldsBeginOffset, &signedFieldsEndOffset);
@@ -86,8 +86,8 @@
 }
 
 void KeyChain::sign
-  (Data &data, const unsigned char *publicKeyDer, unsigned int publicKeyDerLength, 
-   const unsigned char *privateKeyDer, unsigned int privateKeyDerLength, WireFormat &wireFormat)
+  (Data& data, const unsigned char *publicKeyDer, unsigned int publicKeyDerLength, 
+   const unsigned char *privateKeyDer, unsigned int privateKeyDerLength, WireFormat& wireFormat)
 {
   // Set the public key.
   setSha256(publicKeyDer, publicKeyDerLength, data.getSignedInfo().getPublisherPublicKeyDigest().getPublisherPublicKeyDigest());
@@ -116,18 +116,18 @@
   data.getSignature().setSignature(signature, signatureLength);
 }
 
-void KeyChain::defaultSign(Data &data, WireFormat &wireFormat)
+void KeyChain::defaultSign(Data& data, WireFormat& wireFormat)
 {
   sign(data, DEFAULT_PUBLIC_KEY_DER, sizeof(DEFAULT_PUBLIC_KEY_DER), DEFAULT_PRIVATE_KEY_DER, sizeof(DEFAULT_PRIVATE_KEY_DER), wireFormat);
 }
 
-void KeyChain::defaultSign(Data &data)
+void KeyChain::defaultSign(Data& data)
 {
   sign(data, DEFAULT_PUBLIC_KEY_DER, sizeof(DEFAULT_PUBLIC_KEY_DER), DEFAULT_PRIVATE_KEY_DER, sizeof(DEFAULT_PRIVATE_KEY_DER),
        *WireFormat::getDefaultWireFormat());
 }
 
-bool KeyChain::selfVerifyData(const unsigned char *input, unsigned int inputLength, WireFormat &wireFormat)
+bool KeyChain::selfVerifyData(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat)
 {
   // Decode the data packet and digest the data fields.
   Data data;
diff --git a/ndn-cpp/security/key-chain.hpp b/ndn-cpp/security/key-chain.hpp
index 662e6a4..0d3873e 100644
--- a/ndn-cpp/security/key-chain.hpp
+++ b/ndn-cpp/security/key-chain.hpp
@@ -25,21 +25,21 @@
    * @param wireFormat The WireFormat for calling encodeData.
    */
   static void sign
-    (Data &data, const unsigned char *publicKeyDer, unsigned int publicKeyDerLength, 
-     const unsigned char *privateKeyDer, unsigned int privateKeyDerLength, WireFormat &wireFormat);
+    (Data& data, const unsigned char *publicKeyDer, unsigned int publicKeyDerLength, 
+     const unsigned char *privateKeyDer, unsigned int privateKeyDerLength, WireFormat& wireFormat);
 
   /**
    * Call sign with the default public and private keys.
    * @param data
    * @param wireFormat The WireFormat for calling encodeData.
    */
-  static void defaultSign(Data &data, WireFormat &wireFormat);
+  static void defaultSign(Data& data, WireFormat& wireFormat);
 
   /**
    * Call sign with the default public and private keys.  For wireFormat, use WireFormat::getDefaultWireFormat().
    * @param data
    */
-  static void defaultSign(Data &data);
+  static void defaultSign(Data& data);
   
   /**
    * Use the WireFormat to decode the input as a Data packet and use the public key in the key locator to 
@@ -51,7 +51,7 @@
    * @return true if the public key in the Data object verifies the object, false if not or if the Data object
    * doesn't have a public key.
    */
-  static bool selfVerifyData(const unsigned char *input, unsigned int inputLength, WireFormat &wireFormat);
+  static bool selfVerifyData(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat);
   
   static bool selfVerifyData(const unsigned char *input, unsigned int inputLength)
   {
