globa: Change unsigned int to size_t where it is the size of a byte array or an index/offset into it.
diff --git a/ndn-cpp/security/identity/memory-private-key-storage.cpp b/ndn-cpp/security/identity/memory-private-key-storage.cpp
index 0fef285..bab5df8 100644
--- a/ndn-cpp/security/identity/memory-private-key-storage.cpp
+++ b/ndn-cpp/security/identity/memory-private-key-storage.cpp
@@ -44,7 +44,7 @@
}
Blob
-MemoryPrivateKeyStorage::sign(const uint8_t *data, unsigned int dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm)
+MemoryPrivateKeyStorage::sign(const uint8_t *data, size_t dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm)
{
if (digestAlgorithm != DIGEST_ALGORITHM_SHA256)
return Blob();
@@ -62,11 +62,11 @@
if (!RSA_sign(NID_sha256, digest, sizeof(digest), signatureBits, &signatureBitsLength, privateKey->second->getPrivateKey()))
throw SecurityException("Error in RSA_sign");
- return Blob(signatureBits, signatureBitsLength);
+ return Blob(signatureBits, (size_t)signatureBitsLength);
}
Blob
-MemoryPrivateKeyStorage::decrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric)
+MemoryPrivateKeyStorage::decrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool isSymmetric)
{
#if 1
throw std::runtime_error("MemoryPrivateKeyStorage::decrypt not implemented");
@@ -74,7 +74,7 @@
}
Blob
-MemoryPrivateKeyStorage::encrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric)
+MemoryPrivateKeyStorage::encrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool isSymmetric)
{
#if 1
throw std::runtime_error("MemoryPrivateKeyStorage::encrypt not implemented");
diff --git a/ndn-cpp/security/identity/memory-private-key-storage.hpp b/ndn-cpp/security/identity/memory-private-key-storage.hpp
index b44f2ba..02f8fbc 100644
--- a/ndn-cpp/security/identity/memory-private-key-storage.hpp
+++ b/ndn-cpp/security/identity/memory-private-key-storage.hpp
@@ -65,7 +65,7 @@
* @return The signature, or a null pointer if signing fails.
*/
virtual Blob
- sign(const uint8_t *data, unsigned int dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm);
+ sign(const uint8_t *data, size_t dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm);
/**
* Decrypt data.
@@ -76,7 +76,7 @@
* @return The decrypted data.
*/
virtual Blob
- decrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric);
+ decrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool isSymmetric);
/**
* Encrypt data.
@@ -87,7 +87,7 @@
* @return The encrypted data.
*/
virtual Blob
- encrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric);
+ encrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool isSymmetric);
/**
* @brief Generate a symmetric key.
diff --git a/ndn-cpp/security/identity/private-key-storage.hpp b/ndn-cpp/security/identity/private-key-storage.hpp
index 0e24eec..0ff0077 100644
--- a/ndn-cpp/security/identity/private-key-storage.hpp
+++ b/ndn-cpp/security/identity/private-key-storage.hpp
@@ -50,7 +50,7 @@
* @return The signature, or a null pointer if signing fails.
*/
virtual Blob
- sign(const uint8_t *data, unsigned int dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256) = 0;
+ sign(const uint8_t *data, size_t dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256) = 0;
Blob
sign(const Blob& data, const Name& keyName, DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256)
@@ -67,7 +67,7 @@
* @return The decrypted data.
*/
virtual Blob
- decrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric = false) = 0;
+ decrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool isSymmetric = false) = 0;
Blob
decrypt(const Name& keyName, const Blob& data, bool isSymmetric = false)
@@ -84,7 +84,7 @@
* @return The encrypted data.
*/
virtual Blob
- encrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric = false) = 0;
+ encrypt(const Name& keyName, const uint8_t* data, size_t dataLength, bool isSymmetric = false) = 0;
Blob
encrypt(const Name& keyName, const Blob& data, bool isSymmetric = false)