Code style: Declare (Type& value) instead of (Type &value)
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)
{