diff --git a/ndn-cpp/c/data.h b/ndn-cpp/c/data.h
index 81489f5..6340c8c 100644
--- a/ndn-cpp/c/data.h
+++ b/ndn-cpp/c/data.h
@@ -21,11 +21,11 @@
 struct ndn_Signature {
   uint8_t *digestAlgorithm;      /**< pointer to pre-allocated buffer.  0 for none.
                                         *   If none, default is 2.16.840.1.101.3.4.2.1 (sha-256). */
-  unsigned int digestAlgorithmLength;  /**< length of digestAlgorithm.  0 for none */
+  size_t digestAlgorithmLength;  /**< length of digestAlgorithm.  0 for none */
   uint8_t *witness;              /**< pointer to pre-allocated buffer.  0 for none. */
-  unsigned int witnessLength;          /**< length of witness.  0 for none */
+  size_t witnessLength;          /**< length of witness.  0 for none */
   uint8_t *signature;
-  unsigned int signatureLength;
+  size_t signatureLength;
   struct ndn_PublisherPublicKeyDigest publisherPublicKeyDigest;
   struct ndn_KeyLocator keyLocator;
 };
@@ -36,7 +36,7 @@
  * @param keyNameComponents The pre-allocated array of ndn_NameComponent for the keyLocator.
  * @param maxKeyNameComponents The number of elements in the allocated keyNameComponents array.
  */
-static inline void ndn_Signature_initialize(struct ndn_Signature *self, struct ndn_NameComponent *keyNameComponents, unsigned int maxKeyNameComponents) {
+static inline void ndn_Signature_initialize(struct ndn_Signature *self, struct ndn_NameComponent *keyNameComponents, size_t maxKeyNameComponents) {
   self->digestAlgorithm = 0;
   self->digestAlgorithmLength = 0;
   self->witness = 0;
@@ -82,7 +82,7 @@
   struct ndn_Name name;
   struct ndn_MetaInfo metaInfo;
   uint8_t *content;     /**< pointer to the content */
-  unsigned int contentLength; /**< length of content */
+  size_t contentLength; /**< length of content */
 };
 
 /**
@@ -95,8 +95,8 @@
  * @param maxKeyNameComponents The number of elements in the allocated keyNameComponents array.
  */
 static inline void ndn_Data_initialize
-  (struct ndn_Data *self, struct ndn_NameComponent *nameComponents, unsigned int maxNameComponents, 
-   struct ndn_NameComponent *keyNameComponents, unsigned int maxKeyNameComponents) 
+  (struct ndn_Data *self, struct ndn_NameComponent *nameComponents, size_t maxNameComponents, 
+   struct ndn_NameComponent *keyNameComponents, size_t maxKeyNameComponents) 
 {
   ndn_Signature_initialize(&self->signature, keyNameComponents, maxKeyNameComponents);
   ndn_Name_initialize(&self->name, nameComponents, maxNameComponents);
diff --git a/ndn-cpp/c/encoding/binary-xml-data.c b/ndn-cpp/c/encoding/binary-xml-data.c
index 98dde11..25cf16a 100644
--- a/ndn-cpp/c/encoding/binary-xml-data.c
+++ b/ndn-cpp/c/encoding/binary-xml-data.c
@@ -77,7 +77,7 @@
   if (!(metaInfo->type < 0 || metaInfo->type == ndn_ContentType_DATA)) {
     // Not the default of DATA, so we need to encode the type.
     uint8_t *typeBytes;
-    unsigned int typeBytesLength = 3;
+    size_t typeBytesLength = 3;
     if (metaInfo->type == ndn_ContentType_ENCR)
       typeBytes = "\x10\xD0\x91";
     else if (metaInfo->type == ndn_ContentType_GONE)
@@ -128,7 +128,7 @@
     return error;
   
   uint8_t *typeBytes;
-  unsigned int typeBytesLength;
+  size_t typeBytesLength;
   if ((error = ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
       (decoder, ndn_BinaryXml_DTag_Type, 0, &typeBytes, &typeBytesLength)))
     return error;
@@ -173,7 +173,7 @@
 }
 
 ndn_Error ndn_encodeBinaryXmlData
-  (struct ndn_Data *data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset, struct ndn_BinaryXmlEncoder *encoder)
+  (struct ndn_Data *data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset, struct ndn_BinaryXmlEncoder *encoder)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_ContentObject)))
@@ -203,7 +203,7 @@
 }
 
 ndn_Error ndn_decodeBinaryXmlData
-  (struct ndn_Data *data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset, struct ndn_BinaryXmlDecoder *decoder)
+  (struct ndn_Data *data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset, struct ndn_BinaryXmlDecoder *decoder)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(decoder, ndn_BinaryXml_DTag_ContentObject)))
diff --git a/ndn-cpp/c/encoding/binary-xml-data.h b/ndn-cpp/c/encoding/binary-xml-data.h
index caf9e35..f5865ba 100644
--- a/ndn-cpp/c/encoding/binary-xml-data.h
+++ b/ndn-cpp/c/encoding/binary-xml-data.h
@@ -27,7 +27,7 @@
  * @return 0 for success, else an error code.
  */
 ndn_Error ndn_encodeBinaryXmlData
-  (struct ndn_Data *data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset, struct ndn_BinaryXmlEncoder *encoder);
+  (struct ndn_Data *data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset, struct ndn_BinaryXmlEncoder *encoder);
 
 /**
  * Decode the data packet as binary XML and set the fields in the data object.
@@ -40,7 +40,7 @@
  * @return 0 for success, else an error code.
  */
 ndn_Error ndn_decodeBinaryXmlData
-  (struct ndn_Data *data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset, struct ndn_BinaryXmlDecoder *decoder);
+  (struct ndn_Data *data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset, struct ndn_BinaryXmlDecoder *decoder);
 
 #ifdef __cplusplus
 }
diff --git a/ndn-cpp/c/encoding/binary-xml-decoder.c b/ndn-cpp/c/encoding/binary-xml-decoder.c
index 4be2450..6cbb8ac 100644
--- a/ndn-cpp/c/encoding/binary-xml-decoder.c
+++ b/ndn-cpp/c/encoding/binary-xml-decoder.c
@@ -34,11 +34,11 @@
  * @param resultOut output the parsed integer.
  * @return 0 for success, else an error code, including if an element of value is not a decimal digit.
  */
-static ndn_Error parseUnsignedDecimalInt(uint8_t *value, unsigned int valueLength, unsigned int *resultOut)
+static ndn_Error parseUnsignedDecimalInt(uint8_t *value, size_t valueLength, unsigned int *resultOut)
 {
   unsigned int result = 0;
   
-  unsigned int i;
+  size_t i;
   for (i = 0; i < valueLength; ++i) {
     uint8_t digit = value[i];
     if (!(digit >= '0' && digit <= '9'))
@@ -125,7 +125,7 @@
 
   unsigned int type;
   unsigned int value;
-  unsigned int saveOffset = self->offset;
+  size_t saveOffset = self->offset;
   ndn_Error error = ndn_BinaryXmlDecoder_decodeTypeAndValue(self, &type, &value);
   // Restore offset.
   self->offset = saveOffset;
@@ -140,7 +140,7 @@
 }
 
 ndn_Error ndn_BinaryXmlDecoder_readBinaryDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, unsigned int *valueLength)
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, size_t *valueLength)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(self, expectedTag)))
@@ -160,10 +160,12 @@
   }
   
   unsigned int itemType;
-  if ((error = ndn_BinaryXmlDecoder_decodeTypeAndValue(self, &itemType, valueLength)))
+  unsigned int uintValueLength;
+  if ((error = ndn_BinaryXmlDecoder_decodeTypeAndValue(self, &itemType, &uintValueLength)))
     return error;
   // Ignore itemType.
   *value = self->input + self->offset;
+  *valueLength = (size_t)uintValueLength;
   self->offset += *valueLength;
   
   if ((error = ndn_BinaryXmlDecoder_readElementClose(self)))
@@ -173,7 +175,7 @@
 }
 
 ndn_Error ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, unsigned int *valueLength)
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, size_t *valueLength)
 {
   ndn_Error error;
   int gotExpectedTag;
@@ -192,18 +194,20 @@
 }
 
 ndn_Error ndn_BinaryXmlDecoder_readUDataDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, unsigned int *valueLength)
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, size_t *valueLength)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(self, expectedTag)))
     return error;
     
   unsigned int itemType;
-  if ((error = ndn_BinaryXmlDecoder_decodeTypeAndValue(self, &itemType, valueLength)))
+  unsigned int uintValueLength;
+  if ((error = ndn_BinaryXmlDecoder_decodeTypeAndValue(self, &itemType, &uintValueLength)))
     return error;
   if (itemType != ndn_BinaryXml_UDATA)
     return NDN_ERROR_item_is_not_UDATA;
   *value = self->input + self->offset;
+  *valueLength = uintValueLength;
   self->offset += *valueLength;
   
   if ((error = ndn_BinaryXmlDecoder_readElementClose(self)))
@@ -213,7 +217,7 @@
 }
 
 ndn_Error ndn_BinaryXmlDecoder_readOptionalUDataDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, unsigned int *valueLength)
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, size_t *valueLength)
 {
   ndn_Error error;
   int gotExpectedTag;
@@ -235,7 +239,7 @@
   (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, unsigned int *value)
 {
   uint8_t *udataValue;
-  unsigned int udataValueLength;
+  size_t udataValueLength;
   ndn_Error error;
   if ((error = ndn_BinaryXmlDecoder_readUDataDTagElement(self, expectedTag, &udataValue, &udataValueLength)))
     return error;
@@ -272,7 +276,7 @@
 {
   ndn_Error error;
   uint8_t *bytes;
-  unsigned int bytesLength;
+  size_t bytesLength;
   if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(self, expectedTag, 0, &bytes, &bytesLength)))
     return error;
     
@@ -299,10 +303,10 @@
   return NDN_ERROR_success;
 }
 
-double ndn_BinaryXmlDecoder_unsignedBigEndianToDouble(uint8_t *bytes, unsigned int bytesLength) 
+double ndn_BinaryXmlDecoder_unsignedBigEndianToDouble(uint8_t *bytes, size_t bytesLength) 
 {
   double result = 0.0;
-  unsigned int i;
+  size_t i;
   for (i = 0; i < bytesLength; ++i) {
     result *= 256.0;
     result += (double)bytes[i];
diff --git a/ndn-cpp/c/encoding/binary-xml-decoder.h b/ndn-cpp/c/encoding/binary-xml-decoder.h
index dfa9b97..a520a0f 100644
--- a/ndn-cpp/c/encoding/binary-xml-decoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-decoder.h
@@ -16,11 +16,11 @@
 
 struct ndn_BinaryXmlDecoder {
   uint8_t *input;
-  unsigned int inputLength;
-  unsigned int offset;
+  size_t inputLength;
+  size_t offset;
 };
 
-static inline void ndn_BinaryXmlDecoder_initialize(struct ndn_BinaryXmlDecoder *self, uint8_t *input, unsigned int inputLength) 
+static inline void ndn_BinaryXmlDecoder_initialize(struct ndn_BinaryXmlDecoder *self, uint8_t *input, size_t inputLength) 
 {
   self->input = input;
   self->inputLength = inputLength;
@@ -78,7 +78,7 @@
  * and the binary data is absent
  */
 ndn_Error ndn_BinaryXmlDecoder_readBinaryDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, unsigned int *valueLength);
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, size_t *valueLength);
 
 /**
  * Peek at the next element and if it is the expectedTag, call ndn_BinaryXmlDecoder_readBinaryDTagElement.
@@ -93,7 +93,7 @@
  * @return 0 for success, else an error code, including if allowNull is 0 and the binary data is absent
  */
 ndn_Error ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, unsigned int *valueLength);
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, size_t *valueLength);
 
 /**
  * Decode the header from self's input starting at offset, expecting the type to be DTAG and the value to be expectedTag.
@@ -106,7 +106,7 @@
  * @return 0 for success, else an error code, including an error if not the expected tag, or if the item is not UDATA.
  */
 ndn_Error ndn_BinaryXmlDecoder_readUDataDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, unsigned int *valueLength);
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, size_t *valueLength);
 
 /**
  * Peek at the next element and if it is the expectedTag, call ndn_BinaryXmlDecoder_readUDataDTagElement.
@@ -120,7 +120,7 @@
  * @return 0 for success, else an error code.
  */
 ndn_Error ndn_BinaryXmlDecoder_readOptionalUDataDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, unsigned int *valueLength);
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, size_t *valueLength);
 
 /**
  * Decode the header from self's input starting at offset, expecting the type to be DTAG and the value to be expectedTag.
@@ -177,14 +177,14 @@
  * @param bytesLength the length of bytes
  * @return the result
  */
-double ndn_BinaryXmlDecoder_unsignedBigEndianToDouble(uint8_t *bytes, unsigned int bytesLength); 
+double ndn_BinaryXmlDecoder_unsignedBigEndianToDouble(uint8_t *bytes, size_t bytesLength); 
 
 /**
  * Set the offset into the input, used for the next read.
  * @param self pointer to the ndn_BinaryXmlDecoder struct
  * @param offset the new offset
  */
-static inline void ndn_BinaryXmlDecoder_seek(struct ndn_BinaryXmlDecoder *self, unsigned int offset) 
+static inline void ndn_BinaryXmlDecoder_seek(struct ndn_BinaryXmlDecoder *self, size_t offset) 
 {
   self->offset = offset;
 }
diff --git a/ndn-cpp/c/encoding/binary-xml-element-reader.c b/ndn-cpp/c/encoding/binary-xml-element-reader.c
index 51f635f..350a978 100644
--- a/ndn-cpp/c/encoding/binary-xml-element-reader.c
+++ b/ndn-cpp/c/encoding/binary-xml-element-reader.c
@@ -7,7 +7,7 @@
 #include "binary-xml-element-reader.h"
 
 ndn_Error ndn_BinaryXmlElementReader_onReceivedData
-  (struct ndn_BinaryXmlElementReader *self, uint8_t *data, unsigned int dataLength)
+  (struct ndn_BinaryXmlElementReader *self, uint8_t *data, size_t dataLength)
 {
   // Process multiple objects in the data.
   while(1) {
diff --git a/ndn-cpp/c/encoding/binary-xml-element-reader.h b/ndn-cpp/c/encoding/binary-xml-element-reader.h
index cb962cd..c2b3777 100644
--- a/ndn-cpp/c/encoding/binary-xml-element-reader.h
+++ b/ndn-cpp/c/encoding/binary-xml-element-reader.h
@@ -19,7 +19,7 @@
  * will be passed to onReceivedElement.
  */
 struct ndn_ElementListener {
-  void (*onReceivedElement)(struct ndn_ElementListener *self, uint8_t *element, unsigned int elementLength); /**< see ndn_ElementListener_initialize */
+  void (*onReceivedElement)(struct ndn_ElementListener *self, uint8_t *element, size_t elementLength); /**< see ndn_ElementListener_initialize */
 };
 
 /**
@@ -29,7 +29,7 @@
  * self is the pointer to this ndn_ElementListener struct.  See ndn_BinaryXmlElementReader_onReceivedData.
  */
 static inline void ndn_ElementListener_initialize
-  (struct ndn_ElementListener *self, void (*onReceivedElement)(struct ndn_ElementListener *self, uint8_t *element, unsigned int elementLength))
+  (struct ndn_ElementListener *self, void (*onReceivedElement)(struct ndn_ElementListener *self, uint8_t *element, size_t elementLength))
 {
   self->onReceivedElement = onReceivedElement;
 }
@@ -45,7 +45,7 @@
   struct ndn_BinaryXmlStructureDecoder structureDecoder;
   int usePartialData;
   struct ndn_DynamicUInt8Array partialData;
-  unsigned int partialDataLength;
+  size_t partialDataLength;
 };
 
 /**
@@ -58,7 +58,7 @@
  */
 static inline void ndn_BinaryXmlElementReader_initialize
   (struct ndn_BinaryXmlElementReader *self, struct ndn_ElementListener *elementListener,
-   uint8_t *buffer, unsigned int bufferLength, uint8_t * (*reallocFunction)(struct ndn_DynamicUInt8Array *self, uint8_t *, unsigned int))
+   uint8_t *buffer, size_t bufferLength, uint8_t * (*reallocFunction)(struct ndn_DynamicUInt8Array *self, uint8_t *, size_t))
 {
   self->elementListener = elementListener;
   ndn_BinaryXmlStructureDecoder_initialize(&self->structureDecoder);
@@ -75,7 +75,7 @@
  * @return 0 for success, else an error code
  */
 ndn_Error ndn_BinaryXmlElementReader_onReceivedData
-  (struct ndn_BinaryXmlElementReader *self, uint8_t *data, unsigned int dataLength);
+  (struct ndn_BinaryXmlElementReader *self, uint8_t *data, size_t dataLength);
 
 #ifdef __cplusplus
 }
diff --git a/ndn-cpp/c/encoding/binary-xml-encoder.c b/ndn-cpp/c/encoding/binary-xml-encoder.c
index fce9b2d..652de3e 100644
--- a/ndn-cpp/c/encoding/binary-xml-encoder.c
+++ b/ndn-cpp/c/encoding/binary-xml-encoder.c
@@ -24,7 +24,7 @@
  * @param arrayLength the length of the array
  * @return 0 for success, else an error code
  */
-static ndn_Error writeArray(struct ndn_BinaryXmlEncoder *self, uint8_t *array, unsigned int arrayLength)
+static ndn_Error writeArray(struct ndn_BinaryXmlEncoder *self, uint8_t *array, size_t arrayLength)
 {
   ndn_Error error;
   if ((error = ndn_DynamicUInt8Array_ensureLength(self->output, self->offset + arrayLength)))
@@ -39,7 +39,7 @@
 /**
  * Return the number of bytes to encode a header of value x.
  */
-static unsigned int getNHeaderEncodingBytes(unsigned int x) 
+static size_t getNHeaderEncodingBytes(unsigned int x) 
 {
   // Do a quick check for pre-compiled results.
   if (x <= ENCODING_LIMIT_1_BYTE) 
@@ -49,7 +49,7 @@
   if (x <= ENCODING_LIMIT_3_BYTES) 
     return 3;
   
-  unsigned int nBytes = 1;
+  size_t nBytes = 1;
   
   // Last byte gives you TT_VALUE_BITS.
   // Remainder each gives you REGULAR_VALUE_BITS.
@@ -67,7 +67,7 @@
  * @param array
  * @param length
  */
-static void reverse(uint8_t *array, unsigned int length) 
+static void reverse(uint8_t *array, size_t length) 
 {
   if (length == 0)
     return;
@@ -121,10 +121,10 @@
  * @return 0 for success, else an error code
  */
 static ndn_Error reverseBufferAndInsertHeader
-  (struct ndn_BinaryXmlEncoder *self, unsigned int startOffset, unsigned int type)
+  (struct ndn_BinaryXmlEncoder *self, size_t startOffset, unsigned int type)
 {
-  unsigned int nBufferBytes = self->offset - startOffset;
-  unsigned int nHeaderBytes = getNHeaderEncodingBytes(nBufferBytes);
+  size_t nBufferBytes = self->offset - startOffset;
+  size_t nHeaderBytes = getNHeaderEncodingBytes(nBufferBytes);
   ndn_Error error;
   if ((error = ndn_DynamicUInt8Array_ensureLength(self->output, self->offset + nHeaderBytes)))
     return error;
@@ -177,7 +177,7 @@
     return NDN_ERROR_header_type_is_out_of_range;
   
   // Encode backwards. Calculate how many bytes we need.
-  unsigned int nEncodingBytes = getNHeaderEncodingBytes(value);
+  size_t nEncodingBytes = getNHeaderEncodingBytes(value);
   ndn_Error error;
   if ((error = ndn_DynamicUInt8Array_ensureLength(self->output, self->offset + nEncodingBytes)))
     return error;
@@ -190,7 +190,7 @@
   value >>= ndn_BinaryXml_TT_VALUE_BITS;
   
   // Rest of value goes into preceding bytes, 7 bits per byte. (Zero top bit is "more" flag.)
-  unsigned int i = self->offset + nEncodingBytes - 2;
+  size_t i = self->offset + nEncodingBytes - 2;
   while (value != 0 && i >= self->offset) {
     self->output->array[i] = (value & ndn_BinaryXml_REGULAR_VALUE_MASK);
     value >>= ndn_BinaryXml_REGULAR_VALUE_BITS;
@@ -217,7 +217,7 @@
   return NDN_ERROR_success;
 }
 
-ndn_Error ndn_BinaryXmlEncoder_writeBlob(struct ndn_BinaryXmlEncoder *self, uint8_t *value, unsigned int valueLength)
+ndn_Error ndn_BinaryXmlEncoder_writeBlob(struct ndn_BinaryXmlEncoder *self, uint8_t *value, size_t valueLength)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlEncoder_encodeTypeAndValue(self, ndn_BinaryXml_BLOB, valueLength)))
@@ -229,7 +229,7 @@
   return NDN_ERROR_success;
 }
 
-ndn_Error ndn_BinaryXmlEncoder_writeBlobDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, unsigned int valueLength)
+ndn_Error ndn_BinaryXmlEncoder_writeBlobDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, size_t valueLength)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(self, tag)))
@@ -244,7 +244,7 @@
   return NDN_ERROR_success;
 }
 
-ndn_Error ndn_BinaryXmlEncoder_writeUData(struct ndn_BinaryXmlEncoder *self, uint8_t *value, unsigned int valueLength)
+ndn_Error ndn_BinaryXmlEncoder_writeUData(struct ndn_BinaryXmlEncoder *self, uint8_t *value, size_t valueLength)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlEncoder_encodeTypeAndValue(self, ndn_BinaryXml_UDATA, valueLength)))
@@ -256,7 +256,7 @@
   return NDN_ERROR_success;
 }
 
-ndn_Error ndn_BinaryXmlEncoder_writeUDataDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, unsigned int valueLength)
+ndn_Error ndn_BinaryXmlEncoder_writeUDataDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, size_t valueLength)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(self, tag)))
@@ -274,7 +274,7 @@
 ndn_Error ndn_BinaryXmlEncoder_writeUnsignedDecimalInt(struct ndn_BinaryXmlEncoder *self, unsigned int value)
 {
   // First write the decimal int (to find out how many bytes it is), then shift it forward to make room for the header.
-  unsigned int startOffset = self->offset;
+  size_t startOffset = self->offset;
   
   ndn_Error error;
   if ((error = encodeReversedUnsignedDecimalInt(self, value)))
@@ -307,7 +307,7 @@
   splitAbsDouble(value, &hi32, &lo32);
   
   // First encode the big endian backwards, then reverseBufferAndInsertHeader will reverse it.
-  unsigned int startOffset = self->offset;
+  size_t startOffset = self->offset;
   
   ndn_Error error;
   while (lo32 != 0) {
diff --git a/ndn-cpp/c/encoding/binary-xml-encoder.h b/ndn-cpp/c/encoding/binary-xml-encoder.h
index 3cf4a89..c457185 100644
--- a/ndn-cpp/c/encoding/binary-xml-encoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-encoder.h
@@ -20,7 +20,7 @@
  */
 struct ndn_BinaryXmlEncoder {
   struct ndn_DynamicUInt8Array *output; /**< A pointer to a ndn_DynamicUInt8Array which receives the encoded output */
-  unsigned int offset;             /**< the offset into output.array for the next encoding */
+  size_t offset;                        /**< the offset into output.array for the next encoding */
 };
 
 /**
@@ -70,7 +70,7 @@
  * @param valueLength the length of the array
  * @return 0 for success, else an error code
  */
-ndn_Error ndn_BinaryXmlEncoder_writeBlob(struct ndn_BinaryXmlEncoder *self, uint8_t *value, unsigned int valueLength);
+ndn_Error ndn_BinaryXmlEncoder_writeBlob(struct ndn_BinaryXmlEncoder *self, uint8_t *value, size_t valueLength);
 
 /**
  * Write an element start header using DTAG with the tag to self->output, then the blob, then an element close.
@@ -81,7 +81,7 @@
  * @param valueLength the length of the array
  * @return 0 for success, else an error code
  */
-ndn_Error ndn_BinaryXmlEncoder_writeBlobDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, unsigned int valueLength);
+ndn_Error ndn_BinaryXmlEncoder_writeBlobDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, size_t valueLength);
 
 /**
  * If value or valueLen is 0 then do nothing, otherwise call ndn_BinaryXmlEncoder_writeBlobDTagElement.
@@ -92,7 +92,7 @@
  * @return 0 for success, else an error code
  */
 static inline ndn_Error ndn_BinaryXmlEncoder_writeOptionalBlobDTagElement
-  (struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, unsigned int valueLength)
+  (struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, size_t valueLength)
 {
   if (value && valueLength > 0)
     return ndn_BinaryXmlEncoder_writeBlobDTagElement(self, tag, value, valueLength);
@@ -107,7 +107,7 @@
  * @param valueLength the length of the array
  * @return 0 for success, else an error code
  */
-ndn_Error ndn_BinaryXmlEncoder_writeUData(struct ndn_BinaryXmlEncoder *self, uint8_t *value, unsigned int valueLength);
+ndn_Error ndn_BinaryXmlEncoder_writeUData(struct ndn_BinaryXmlEncoder *self, uint8_t *value, size_t valueLength);
 
 /**
  * Write an element start header using DTAG with the tag to self->output, then the UDATA value, then an element close.
@@ -118,7 +118,7 @@
  * @param valueLength the length of the array
  * @return 0 for success, else an error code
  */
-ndn_Error ndn_BinaryXmlEncoder_writeUDataDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, unsigned int valueLength);
+ndn_Error ndn_BinaryXmlEncoder_writeUDataDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, size_t valueLength);
 
 /**
  * If value or valueLen is 0 then do nothing, otherwise call ndn_BinaryXmlEncoder_writeUDataDTagElement.
@@ -129,7 +129,7 @@
  * @return 0 for success, else an error code
  */
 static inline ndn_Error ndn_BinaryXmlEncoder_writeOptionalUDataDTagElement
-  (struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, unsigned int valueLength)
+  (struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, size_t valueLength)
 {
   if (value && valueLength > 0)
     return ndn_BinaryXmlEncoder_writeUDataDTagElement(self, tag, value, valueLength);
@@ -166,7 +166,7 @@
 static inline ndn_Error ndn_BinaryXmlEncoder_writeOptionalUnsignedDecimalIntDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, int value)
 {
   if (value >= 0)
-    return ndn_BinaryXmlEncoder_writeUnsignedDecimalIntDTagElement(self, tag, (unsigned int)value);
+    return ndn_BinaryXmlEncoder_writeUnsignedDecimalIntDTagElement(self, tag, (size_t)value);
   else
     return NDN_ERROR_success;
 }
diff --git a/ndn-cpp/c/encoding/binary-xml-interest.c b/ndn-cpp/c/encoding/binary-xml-interest.c
index ee20f05..a43ce3b 100644
--- a/ndn-cpp/c/encoding/binary-xml-interest.c
+++ b/ndn-cpp/c/encoding/binary-xml-interest.c
@@ -21,7 +21,7 @@
     return error;
   
   // TODO: Do we want to order the components (except for ANY)?
-  unsigned int i;
+  size_t i;
   for (i = 0; i < exclude->nEntries; ++i) {
     struct ndn_ExcludeEntry *entry = &exclude->entries[i];
     
@@ -61,7 +61,7 @@
     if (gotExpectedTag) {
       // Component
       uint8_t *component;
-      unsigned int componentLen;
+      size_t componentLen;
       if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Component, 0, &component, &componentLen)))
         return error;
     
@@ -97,7 +97,7 @@
     if (gotExpectedTag) {
       // Skip the Bloom and treat it as Any.
       uint8_t *value;
-      unsigned int valueLen;
+      size_t valueLen;
       if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Bloom, 0, &value, &valueLen)))
         return error;
     
diff --git a/ndn-cpp/c/encoding/binary-xml-name.c b/ndn-cpp/c/encoding/binary-xml-name.c
index f36e0ef..00f5858 100644
--- a/ndn-cpp/c/encoding/binary-xml-name.c
+++ b/ndn-cpp/c/encoding/binary-xml-name.c
@@ -15,7 +15,7 @@
   if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_Name)))
     return error;
   
-  unsigned int i;
+  size_t i;
   for (i = 0; i < name->nComponents; ++i) {
     if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
         (encoder, ndn_BinaryXml_DTag_Component, name->components[i].value, name->components[i].valueLength)))
@@ -45,7 +45,7 @@
       break;
     
     uint8_t *component;
-    unsigned int componentLen;
+    size_t componentLen;
     if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Component, 0, &component, &componentLen)))
       return error;
     
diff --git a/ndn-cpp/c/encoding/binary-xml-structure-decoder.c b/ndn-cpp/c/encoding/binary-xml-structure-decoder.c
index 603d07d..a8e2f09 100644
--- a/ndn-cpp/c/encoding/binary-xml-structure-decoder.c
+++ b/ndn-cpp/c/encoding/binary-xml-structure-decoder.c
@@ -31,7 +31,7 @@
 }
 
 ndn_Error ndn_BinaryXmlStructureDecoder_findElementEnd
-  (struct ndn_BinaryXmlStructureDecoder *self, uint8_t *input, unsigned int inputLength) 
+  (struct ndn_BinaryXmlStructureDecoder *self, uint8_t *input, size_t inputLength) 
 {
   if (self->gotElementEnd)
     // Someone is calling when we already got the end.
@@ -64,14 +64,14 @@
         continue;
       }
         
-      unsigned int startingHeaderLength = self->headerLength;
+      size_t startingHeaderLength = self->headerLength;
       while (1) {
         if (self->offset >= inputLength) {
           // We can't get all of the header bytes from this input. Save in headerBuffer.
           if (self->headerLength > sizeof(self->headerBuffer))
             return NDN_ERROR_cannot_store_more_header_bytes_than_the_size_of_headerBuffer;
           self->useHeaderBuffer = 1;
-          unsigned int nNewBytes = self->headerLength - startingHeaderLength;
+          size_t nNewBytes = self->headerLength - startingHeaderLength;
           ndn_memcpy(self->headerBuffer + startingHeaderLength, input + (self->offset - nNewBytes), nNewBytes);
             
           return NDN_ERROR_success;
@@ -89,7 +89,7 @@
         // Copy the remaining bytes into headerBuffer.
         if (self->headerLength > sizeof(self->headerBuffer))
           return NDN_ERROR_cannot_store_more_header_bytes_than_the_size_of_headerBuffer;
-        unsigned int nNewBytes = self->headerLength - startingHeaderLength;
+        size_t nNewBytes = self->headerLength - startingHeaderLength;
         ndn_memcpy(self->headerBuffer + startingHeaderLength, input + (self->offset - nNewBytes), nNewBytes);
 
         // Use a local decoder just for the headerBuffer.
@@ -132,7 +132,7 @@
         return NDN_ERROR_findElementEnd_unrecognized_header_type;
     }  
     else if (self->state == ndn_BinaryXmlStructureDecoder_READ_BYTES) {
-      unsigned int nRemainingBytes = inputLength - self->offset;
+      size_t nRemainingBytes = inputLength - self->offset;
       if (nRemainingBytes < self->nBytesToRead) {
         // Need more.
         self->offset += nRemainingBytes;
diff --git a/ndn-cpp/c/encoding/binary-xml-structure-decoder.h b/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
index f8bf5d0..63420d2 100644
--- a/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
@@ -16,10 +16,10 @@
 
 struct ndn_BinaryXmlStructureDecoder {
   int gotElementEnd; /**< boolean */
-  unsigned int offset;
+  size_t offset;
   int level;
   int state;
-  unsigned int headerLength;
+  size_t headerLength;
   int useHeaderBuffer; /**< boolean */
   // 10 bytes is enough to hold an encoded header with a type and a 64 bit value.
   uint8_t headerBuffer[10];
@@ -44,14 +44,14 @@
  * @return 0 for success, else an error code
  */
 ndn_Error ndn_BinaryXmlStructureDecoder_findElementEnd
-  (struct ndn_BinaryXmlStructureDecoder *self, uint8_t *input, unsigned int inputLength);
+  (struct ndn_BinaryXmlStructureDecoder *self, uint8_t *input, size_t inputLength);
 
 /**
  * Set the offset into the input, used for the next read.
  * @param self pointer to the ndn_BinaryXmlStructureDecoder struct
  * @param offset the new offset
  */
-static inline void ndn_BinaryXmlStructureDecoder_seek(struct ndn_BinaryXmlStructureDecoder *self, unsigned int offset) 
+static inline void ndn_BinaryXmlStructureDecoder_seek(struct ndn_BinaryXmlStructureDecoder *self, size_t offset) 
 {
   self->offset = offset;
 }
diff --git a/ndn-cpp/c/forwarding-entry.h b/ndn-cpp/c/forwarding-entry.h
index 8a77e2f..a57429d 100644
--- a/ndn-cpp/c/forwarding-entry.h
+++ b/ndn-cpp/c/forwarding-entry.h
@@ -20,7 +20,7 @@
  */
 struct ndn_ForwardingEntry {
   uint8_t *action;     /**< pointer to pre-allocated buffer.  0 for none. */
-  unsigned int actionLength; /**< length of action.  0 for none. */
+  size_t actionLength; /**< length of action.  0 for none. */
   struct ndn_Name prefix;
   struct ndn_PublisherPublicKeyDigest publisherPublicKeyDigest;
   int faceId;               /**< -1 for none. */
@@ -36,7 +36,7 @@
  * @param maxPrefixNameComponents the number of elements in the allocated prefixNameComponents array
  */
 static inline void ndn_ForwardingEntry_initialize
-  (struct ndn_ForwardingEntry *self, struct ndn_NameComponent *prefixNameComponents, unsigned int maxPrefixNameComponents) 
+  (struct ndn_ForwardingEntry *self, struct ndn_NameComponent *prefixNameComponents, size_t maxPrefixNameComponents) 
 {
   self->action = 0;
   self->actionLength = 0;
diff --git a/ndn-cpp/c/interest.c b/ndn-cpp/c/interest.c
index 78bd9b8..0e32368 100644
--- a/ndn-cpp/c/interest.c
+++ b/ndn-cpp/c/interest.c
@@ -20,7 +20,7 @@
 
 int ndn_Exclude_matches(struct ndn_Exclude *self, struct ndn_NameComponent *component)
 {
-  unsigned int i;
+  size_t i;
   for (i = 0; i < self->nEntries; ++i) {
     if (self->entries[i].type == ndn_Exclude_ANY) {
       struct ndn_ExcludeEntry *lowerBound = 0;
@@ -28,7 +28,7 @@
         lowerBound = self->entries + (i - 1);
       
       // Find the upper bound, possibly skipping over multiple ANY in a row.
-      unsigned int iUpperBound;
+      size_t iUpperBound;
       struct ndn_ExcludeEntry *upperBound = 0;
       for (iUpperBound = i + 1; iUpperBound < self->nEntries; ++iUpperBound) {
         if (self->entries[iUpperBound].type == ndn_Exclude_COMPONENT) {
diff --git a/ndn-cpp/c/interest.h b/ndn-cpp/c/interest.h
index ad1b700..af067a3 100644
--- a/ndn-cpp/c/interest.h
+++ b/ndn-cpp/c/interest.h
@@ -34,7 +34,7 @@
  * @param component the pre-allocated buffer for the component value, only used if type is ndn_Exclude_COMPONENT
  * @param componentLength the number of bytes in value, only used if type is ndn_Exclude_COMPONENT
  */
-static inline void ndn_ExcludeEntry_initialize(struct ndn_ExcludeEntry *self, ndn_ExcludeType type, uint8_t *component, unsigned int componentLength) 
+static inline void ndn_ExcludeEntry_initialize(struct ndn_ExcludeEntry *self, ndn_ExcludeType type, uint8_t *component, size_t componentLength) 
 {
   self->type = type;
   ndn_NameComponent_initialize(&self->component, component, componentLength);
@@ -45,8 +45,8 @@
  */
 struct ndn_Exclude {
   struct ndn_ExcludeEntry *entries;  /**< pointer to the array of entries. */
-  unsigned int maxEntries;           /**< the number of elements in the allocated entries array */
-  unsigned int nEntries;             /**< the number of entries in the exclude, 0 for no exclude */
+  size_t maxEntries;                 /**< the number of elements in the allocated entries array */
+  size_t nEntries;                   /**< the number of entries in the exclude, 0 for no exclude */
 };
 /**
  * Initialize an ndn_Exclude struct with the entries array.
@@ -54,7 +54,7 @@
  * @param entries the pre-allocated array of ndn_ExcludeEntry
  * @param maxEntries the number of elements in the allocated entries array
  */
-static inline void ndn_Exclude_initialize(struct ndn_Exclude *self, struct ndn_ExcludeEntry *entries, unsigned int maxEntries) 
+static inline void ndn_Exclude_initialize(struct ndn_Exclude *self, struct ndn_ExcludeEntry *entries, size_t maxEntries) 
 {
   self->entries = entries;
   self->maxEntries = maxEntries;
@@ -102,8 +102,8 @@
   int answerOriginKind;     /**< -1 for none */
   int scope;                /**< -1 for none */
   double interestLifetimeMilliseconds; /**< milliseconds. -1.0 for none */
-  uint8_t *nonce;     /**< pointer to pre-allocated buffer.  0 for none */
-  unsigned int nonceLength; /**< length of nonce.  0 for none */
+  uint8_t *nonce;           /**< pointer to pre-allocated buffer.  0 for none */
+  size_t nonceLength;       /**< length of nonce.  0 for none */
 };
 
 /**
@@ -116,8 +116,8 @@
  * @param maxExcludeEntries the number of elements in the allocated excludeEntries array
  */
 static inline void ndn_Interest_initialize
-  (struct ndn_Interest *self, struct ndn_NameComponent *nameComponents, unsigned int maxNameComponents,
-   struct ndn_ExcludeEntry *excludeEntries, unsigned int maxExcludeEntries) 
+  (struct ndn_Interest *self, struct ndn_NameComponent *nameComponents, size_t maxNameComponents,
+   struct ndn_ExcludeEntry *excludeEntries, size_t maxExcludeEntries) 
 {
   ndn_Name_initialize(&self->name, nameComponents, maxNameComponents);
   self->minSuffixComponents = -1;
diff --git a/ndn-cpp/c/key.h b/ndn-cpp/c/key.h
index 2069789..814c200 100644
--- a/ndn-cpp/c/key.h
+++ b/ndn-cpp/c/key.h
@@ -31,7 +31,7 @@
  */
 struct ndn_KeyLocator {
   ndn_KeyLocatorType type;     /**< -1 for none */
-  uint8_t *keyData;      /**< A pointer to a pre-allocated buffer for the key data as follows:
+  uint8_t *keyData;            /**< A pointer to a pre-allocated buffer for the key data as follows:
     *   If type is ndn_KeyLocatorType_KEY, the key data.
     *   If type is ndn_KeyLocatorType_CERTIFICATE, the certificate data. 
     *   If type is ndn_KeyLocatorType_KEYNAME and keyNameType is ndn_KeyNameType_PUBLISHER_PUBLIC_KEY_DIGEST, the publisher public key digest. 
@@ -39,7 +39,7 @@
     *   If type is ndn_KeyLocatorType_KEYNAME and keyNameType is ndn_KeyNameType_PUBLISHER_ISSUER_KEY_DIGEST, the publisher issuer key digest. 
     *   If type is ndn_KeyLocatorType_KEYNAME and keyNameType is ndn_KeyNameType_PUBLISHER_ISSUER_CERTIFICATE_DIGEST, the publisher issuer certificate digest. 
     */
-  unsigned int keyDataLength;  /**< The length of keyData. */
+  size_t keyDataLength;        /**< The length of keyData. */
   struct ndn_Name keyName;     /**< The key name (only used if type is ndn_KeyLocatorType_KEYNAME.) */
   ndn_KeyNameType keyNameType; /**< The type of data for keyName, -1 for none. (only used if type is ndn_KeyLocatorType_KEYNAME.) */
 };
@@ -51,7 +51,7 @@
  * @param maxKeyNameComponents The number of elements in the allocated keyNameComponents array.
  */
 static inline void ndn_KeyLocator_initialize
-  (struct ndn_KeyLocator *self, struct ndn_NameComponent *keyNameComponents, unsigned int maxKeyNameComponents) {
+  (struct ndn_KeyLocator *self, struct ndn_NameComponent *keyNameComponents, size_t maxKeyNameComponents) {
   self->type = (ndn_KeyLocatorType)-1;
   self->keyData = 0;
   self->keyDataLength = 0;
diff --git a/ndn-cpp/c/name.c b/ndn-cpp/c/name.c
index a2569f9..ab190ce 100644
--- a/ndn-cpp/c/name.c
+++ b/ndn-cpp/c/name.c
@@ -14,7 +14,7 @@
     return 0;
 
 	// Check if at least one of given components doesn't match.
-  unsigned int i;
+  size_t i;
   for (i = 0; i < self->nComponents; ++i) {
     struct ndn_NameComponent *selfComponent = self->components + i;
     struct ndn_NameComponent *nameComponent = name->components + i;
diff --git a/ndn-cpp/c/name.h b/ndn-cpp/c/name.h
index 5415f6e..9a4159b 100644
--- a/ndn-cpp/c/name.h
+++ b/ndn-cpp/c/name.h
@@ -16,7 +16,7 @@
  */
 struct ndn_NameComponent {
   uint8_t *value;     /**< pointer to the pre-allocated buffer for the component value */
-  unsigned int valueLength; /**< the number of bytes in value */
+  size_t valueLength; /**< the number of bytes in value */
 };
 
 /**
@@ -25,7 +25,7 @@
  * @param value the pre-allocated buffer for the component value
  * @param valueLength the number of bytes in value
  */
-static inline void ndn_NameComponent_initialize(struct ndn_NameComponent *self, uint8_t *value, unsigned int valueLength) 
+static inline void ndn_NameComponent_initialize(struct ndn_NameComponent *self, uint8_t *value, size_t valueLength) 
 {
   self->value = value;
   self->valueLength = valueLength;
@@ -36,8 +36,8 @@
  */
 struct ndn_Name {
   struct ndn_NameComponent *components; /**< pointer to the array of components. */
-  unsigned int maxComponents;           /**< the number of elements in the allocated components array */
-  unsigned int nComponents;             /**< the number of components in the name */
+  size_t maxComponents;                 /**< the number of elements in the allocated components array */
+  size_t nComponents;                   /**< the number of components in the name */
 };
 
 /**
@@ -46,7 +46,7 @@
  * @param components the pre-allocated array of ndn_NameComponent
  * @param maxComponents the number of elements in the allocated components array
  */
-static inline void ndn_Name_initialize(struct ndn_Name *self, struct ndn_NameComponent *components, unsigned int maxComponents) 
+static inline void ndn_Name_initialize(struct ndn_Name *self, struct ndn_NameComponent *components, size_t maxComponents) 
 {
   self->components = components;
   self->maxComponents = maxComponents;
diff --git a/ndn-cpp/c/publisher-public-key-digest.h b/ndn-cpp/c/publisher-public-key-digest.h
index 3e02b9b..11d9dec 100644
--- a/ndn-cpp/c/publisher-public-key-digest.h
+++ b/ndn-cpp/c/publisher-public-key-digest.h
@@ -19,7 +19,7 @@
  */
 struct ndn_PublisherPublicKeyDigest {
   uint8_t *publisherPublicKeyDigest;      /**< pointer to pre-allocated buffer.  0 for none */
-  unsigned int publisherPublicKeyDigestLength;  /**< length of publisherPublicKeyDigest.  0 for none */  
+  size_t publisherPublicKeyDigestLength;  /**< length of publisherPublicKeyDigest.  0 for none */  
 };
 
 /**
diff --git a/ndn-cpp/c/transport/socket-transport.c b/ndn-cpp/c/transport/socket-transport.c
index aef13ac..09a5b57 100644
--- a/ndn-cpp/c/transport/socket-transport.c
+++ b/ndn-cpp/c/transport/socket-transport.c
@@ -67,7 +67,7 @@
   return NDN_ERROR_success;
 }
 
-ndn_Error ndn_SocketTransport_send(struct ndn_SocketTransport *self, uint8_t *data, unsigned int dataLength)
+ndn_Error ndn_SocketTransport_send(struct ndn_SocketTransport *self, uint8_t *data, size_t dataLength)
 {
   if (self->socketDescriptor < 0)
     return NDN_ERROR_SocketTransport_socket_is_not_open;
@@ -115,7 +115,7 @@
 }
 
 ndn_Error ndn_SocketTransport_receive
-  (struct ndn_SocketTransport *self, uint8_t *buffer, unsigned int bufferLength, unsigned int *nBytesOut)
+  (struct ndn_SocketTransport *self, uint8_t *buffer, size_t bufferLength, size_t *nBytesOut)
 {
   if (self->socketDescriptor < 0)
     return NDN_ERROR_SocketTransport_socket_is_not_open;
@@ -124,7 +124,7 @@
   if ((nBytes = recv(self->socketDescriptor, buffer, bufferLength, 0)) == -1)
     return NDN_ERROR_SocketTransport_error_in_recv;
 
-  *nBytesOut = (unsigned int)nBytes;
+  *nBytesOut = (size_t)nBytes;
   
   return NDN_ERROR_success;  
 }
diff --git a/ndn-cpp/c/transport/socket-transport.h b/ndn-cpp/c/transport/socket-transport.h
index e1388c3..b0a0979 100644
--- a/ndn-cpp/c/transport/socket-transport.h
+++ b/ndn-cpp/c/transport/socket-transport.h
@@ -50,7 +50,7 @@
  * @param dataLength The number of bytes in data.
  * @return 0 for success, else an error code.
  */
-ndn_Error ndn_SocketTransport_send(struct ndn_SocketTransport *self, uint8_t *data, unsigned int dataLength);
+ndn_Error ndn_SocketTransport_send(struct ndn_SocketTransport *self, uint8_t *data, size_t dataLength);
 
 /**
  * Check if there is data ready on the socket to be received with ndn_SocketTransport_receive.
@@ -71,7 +71,7 @@
  * @return 0 for success, else an error code.
  */
 ndn_Error ndn_SocketTransport_receive
-  (struct ndn_SocketTransport *self, uint8_t *buffer, unsigned int bufferLength, unsigned int *nBytes);
+  (struct ndn_SocketTransport *self, uint8_t *buffer, size_t bufferLength, size_t *nBytes);
 
 /**
  * Close the socket.
diff --git a/ndn-cpp/c/transport/tcp-transport.h b/ndn-cpp/c/transport/tcp-transport.h
index 05902f9..55f2e8e 100644
--- a/ndn-cpp/c/transport/tcp-transport.h
+++ b/ndn-cpp/c/transport/tcp-transport.h
@@ -45,7 +45,7 @@
  * @param dataLength The number of bytes in data.
  * @return 0 for success, else an error code.
  */
-static inline ndn_Error ndn_TcpTransport_send(struct ndn_TcpTransport *self, uint8_t *data, unsigned int dataLength)
+static inline ndn_Error ndn_TcpTransport_send(struct ndn_TcpTransport *self, uint8_t *data, size_t dataLength)
 {
   return ndn_SocketTransport_send(&self->base, data, dataLength);
 }
@@ -72,7 +72,7 @@
  * @return 0 for success, else an error code.
  */
 static inline ndn_Error ndn_TcpTransport_receive
-  (struct ndn_TcpTransport *self, uint8_t *buffer, unsigned int bufferLength, unsigned int *nBytes)
+  (struct ndn_TcpTransport *self, uint8_t *buffer, size_t bufferLength, size_t *nBytes)
 {
   return ndn_SocketTransport_receive(&self->base, buffer, bufferLength, nBytes);
 }
diff --git a/ndn-cpp/c/transport/udp-transport.h b/ndn-cpp/c/transport/udp-transport.h
index fc9a173..20d106b 100644
--- a/ndn-cpp/c/transport/udp-transport.h
+++ b/ndn-cpp/c/transport/udp-transport.h
@@ -45,7 +45,7 @@
  * @param dataLength The number of bytes in data.
  * @return 0 for success, else an error code.
  */
-static inline ndn_Error ndn_UdpTransport_send(struct ndn_UdpTransport *self, uint8_t *data, unsigned int dataLength)
+static inline ndn_Error ndn_UdpTransport_send(struct ndn_UdpTransport *self, uint8_t *data, size_t dataLength)
 {
   return ndn_SocketTransport_send(&self->base, data, dataLength);
 }
@@ -72,7 +72,7 @@
  * @return 0 for success, else an error code.
  */
 static inline ndn_Error ndn_UdpTransport_receive
-  (struct ndn_UdpTransport *self, uint8_t *buffer, unsigned int bufferLength, unsigned int *nBytes)
+  (struct ndn_UdpTransport *self, uint8_t *buffer, size_t bufferLength, size_t *nBytes)
 {
   return ndn_SocketTransport_receive(&self->base, buffer, bufferLength, nBytes);
 }
diff --git a/ndn-cpp/c/util/blob.h b/ndn-cpp/c/util/blob.h
index 4784065..1029185 100644
--- a/ndn-cpp/c/util/blob.h
+++ b/ndn-cpp/c/util/blob.h
@@ -16,7 +16,7 @@
  */
 struct ndn_Blob {
   uint8_t *value;     /**< pointer to the pre-allocated buffer for the value. Must be treated as read only. */
-  unsigned int valueLength; /**< the number of bytes in value. */
+  size_t valueLength; /**< the number of bytes in value. */
 };
 
 /**
@@ -25,7 +25,7 @@
  * @param value The pre-allocated buffer for the value, or 0 for none.
  * @param valueLength The number of bytes in value.
  */
-static inline void ndn_Blob_initialize(struct ndn_Blob *self, uint8_t *value, unsigned int valueLength) 
+static inline void ndn_Blob_initialize(struct ndn_Blob *self, uint8_t *value, size_t valueLength) 
 {
   self->value = value;
   self->valueLength = valueLength;
diff --git a/ndn-cpp/c/util/crypto.c b/ndn-cpp/c/util/crypto.c
index 2cdc91b..ec13f68 100644
--- a/ndn-cpp/c/util/crypto.c
+++ b/ndn-cpp/c/util/crypto.c
@@ -6,7 +6,7 @@
 
 #include "crypto.h"
 
-void ndn_digestSha256(const uint8_t *data, unsigned int dataLength, uint8_t *digest)
+void ndn_digestSha256(const uint8_t *data, size_t dataLength, uint8_t *digest)
 {
   SHA256_CTX sha256;
   SHA256_Init(&sha256);
diff --git a/ndn-cpp/c/util/crypto.h b/ndn-cpp/c/util/crypto.h
index eb7cec5..5bec549 100644
--- a/ndn-cpp/c/util/crypto.h
+++ b/ndn-cpp/c/util/crypto.h
@@ -21,7 +21,7 @@
  * @param dataLength The length of data.
  * @param digest A pointer to a buffer of size SHA256_DIGEST_LENGTH to receive the data.
  */
-void ndn_digestSha256(const uint8_t *data, unsigned int dataLength, uint8_t *digest);
+void ndn_digestSha256(const uint8_t *data, size_t dataLength, uint8_t *digest);
 
 #ifdef __cplusplus
 }
diff --git a/ndn-cpp/c/util/dynamic-uint8-array.c b/ndn-cpp/c/util/dynamic-uint8-array.c
index 5a7e96d..23bfd7c 100644
--- a/ndn-cpp/c/util/dynamic-uint8-array.c
+++ b/ndn-cpp/c/util/dynamic-uint8-array.c
@@ -6,13 +6,13 @@
 
 #include "dynamic-uint8-array.h"
 
-ndn_Error ndn_DynamicUInt8Array_reallocArray(struct ndn_DynamicUInt8Array *self, unsigned int length)
+ndn_Error ndn_DynamicUInt8Array_reallocArray(struct ndn_DynamicUInt8Array *self, size_t length)
 {
   if (!self->realloc)
     return NDN_ERROR_DynamicUInt8Array_realloc_function_pointer_not_supplied;
   
   // See if double is enough.
-  unsigned int newLength = self->length * 2;
+  size_t newLength = self->length * 2;
   if (length > newLength)
     // The needed length is much greater, so use it.
     newLength = length;
diff --git a/ndn-cpp/c/util/dynamic-uint8-array.h b/ndn-cpp/c/util/dynamic-uint8-array.h
index 8b7b489..6548662 100644
--- a/ndn-cpp/c/util/dynamic-uint8-array.h
+++ b/ndn-cpp/c/util/dynamic-uint8-array.h
@@ -16,9 +16,9 @@
 
 struct ndn_DynamicUInt8Array {
   uint8_t *array; /**< the allocated array buffer */
-  unsigned int length;  /**< the length of the allocated array buffer */
+  size_t length;  /**< the length of the allocated array buffer */
   uint8_t * (*realloc)
-    (struct ndn_DynamicUInt8Array *self, uint8_t *array, unsigned int length); /**< a pointer to a function that reallocates array and returns a new pointer to a buffer of
+    (struct ndn_DynamicUInt8Array *self, uint8_t *array, size_t length); /**< a pointer to a function that reallocates array and returns a new pointer to a buffer of
                                                                                       * length bytes, or 0 for error.  On success, the contents of the old buffer are copied to the new one.
                                                                                       * On success, the original array pointer will no longer be used.
                                                                                       * self is a pointer to the struct ndn_DynamicUInt8Array which is calling realloc.
@@ -33,8 +33,8 @@
  * @param reallocFunction see ndn_DynamicUInt8Array_ensureLength.  This may be 0.
  */
 static inline void ndn_DynamicUInt8Array_initialize
-  (struct ndn_DynamicUInt8Array *self, uint8_t *array, unsigned int length, 
-   uint8_t * (*reallocFunction)(struct ndn_DynamicUInt8Array *self, uint8_t *, unsigned int)) 
+  (struct ndn_DynamicUInt8Array *self, uint8_t *array, size_t length, 
+   uint8_t * (*reallocFunction)(struct ndn_DynamicUInt8Array *self, uint8_t *, size_t)) 
 {
   self->array = array;
   self->length = length;
@@ -49,7 +49,7 @@
  * @param length the needed minimum size for self->length
  * @return 0 for success, else an error code if can't reallocate the array
  */
-ndn_Error ndn_DynamicUInt8Array_reallocArray(struct ndn_DynamicUInt8Array *self, unsigned int length);
+ndn_Error ndn_DynamicUInt8Array_reallocArray(struct ndn_DynamicUInt8Array *self, size_t length);
 
 /**
  * Ensure that self->length is greater than or equal to length.  If it is, just return 0 for success.
@@ -59,7 +59,7 @@
  * @param length the needed minimum size for self->length
  * @return 0 for success, else an error code if need to reallocate the array but can't
  */
-static inline ndn_Error ndn_DynamicUInt8Array_ensureLength(struct ndn_DynamicUInt8Array *self, unsigned int length) 
+static inline ndn_Error ndn_DynamicUInt8Array_ensureLength(struct ndn_DynamicUInt8Array *self, size_t length) 
 {
   if (self->length >= length)
     return NDN_ERROR_success;
@@ -76,7 +76,7 @@
  * @return 0 for success, else an error code if need to reallocate the array but can't
  */
 static inline ndn_Error ndn_DynamicUInt8Array_set
-  (struct ndn_DynamicUInt8Array *self, uint8_t *value, unsigned int valueLength, unsigned int offset) 
+  (struct ndn_DynamicUInt8Array *self, uint8_t *value, size_t valueLength, size_t offset) 
 {
   ndn_Error error;
   if ((error = ndn_DynamicUInt8Array_ensureLength(self, valueLength + offset)))
diff --git a/ndn-cpp/c/util/ndn_memory.c b/ndn-cpp/c/util/ndn_memory.c
index db92bde..ba3fc2e 100644
--- a/ndn-cpp/c/util/ndn_memory.c
+++ b/ndn-cpp/c/util/ndn_memory.c
@@ -7,9 +7,9 @@
 #include "ndn_memory.h"
 
 #if !HAVE_MEMCMP
-int ndn_memcmp(uint8_t *buf1, uint8_t *buf2, unsigned int len)
+int ndn_memcmp(uint8_t *buf1, uint8_t *buf2, size_t len)
 {
-  unsigned int i;
+  size_t i;
   
   for (i = 0; i < len; i++) {
     if (buf1[i] > buf2[i])
@@ -25,9 +25,9 @@
 #endif
 
 #if !HAVE_MEMCPY
-void ndn_memcpy(uint8_t *dest, uint8_t *src, unsigned int len)
+void ndn_memcpy(uint8_t *dest, uint8_t *src, size_t len)
 {
-  unsigned int i;
+  size_t i;
   
   for (i = 0; i < len; i++)
     dest[i] = src[i];
@@ -37,9 +37,9 @@
 #endif
 
 #if !HAVE_MEMSET
-void ndn_memset(uint8_t *dest, int val, unsigned int len)
+void ndn_memset(uint8_t *dest, int val, size_t len)
 {
-  unsigned int i;
+  size_t i;
   
   for (i = 0; i < len; i++)
     dest[i] = (uint8_t)val;
diff --git a/ndn-cpp/c/util/ndn_memory.h b/ndn-cpp/c/util/ndn_memory.h
index ba0a85b..68721e8 100644
--- a/ndn-cpp/c/util/ndn_memory.h
+++ b/ndn-cpp/c/util/ndn_memory.h
@@ -22,12 +22,12 @@
 /**
  * Use the library version of memcmp.
  */
-static inline int ndn_memcmp(uint8_t *buf1, uint8_t *buf2, unsigned int len) { return memcmp(buf1, buf2, len); }
+static inline int ndn_memcmp(uint8_t *buf1, uint8_t *buf2, size_t len) { return memcmp(buf1, buf2, len); }
 #else
 /**
  * Use a local implementation of memcmp instead of the library version.
  */
-int ndn_memcmp(uint8_t *buf1, uint8_t *buf2, unsigned int len);
+int ndn_memcmp(uint8_t *buf1, uint8_t *buf2, size_t len);
 #endif
 
 #if HAVE_MEMCPY
@@ -35,12 +35,12 @@
 /**
  * Use the library version of memcpy.
  */
-static inline void ndn_memcpy(uint8_t *dest, uint8_t *src, unsigned int len) { memcpy(dest, src, len); }
+static inline void ndn_memcpy(uint8_t *dest, uint8_t *src, size_t len) { memcpy(dest, src, len); }
 #else
 /**
  * Use a local implementation of memcpy instead of the library version.
  */
-void ndn_memcpy(uint8_t *dest, uint8_t *src, unsigned int len);
+void ndn_memcpy(uint8_t *dest, uint8_t *src, size_t len);
 #endif
 
 #if HAVE_MEMSET
@@ -48,12 +48,12 @@
 /**
  * Use the library version of memset.
  */
-static inline void ndn_memset(uint8_t *dest, int val, unsigned int len) { memset(dest, val, len); }
+static inline void ndn_memset(uint8_t *dest, int val, size_t len) { memset(dest, val, len); }
 #else
 /**
  * Use a local implementation of memset instead of the library version.
  */
-void ndn_memset(uint8_t *dest, int val, unsigned int len);
+void ndn_memset(uint8_t *dest, int val, size_t len);
 #endif
 
 #ifdef __cplusplus
diff --git a/ndn-cpp/c/util/ndn_realloc.c b/ndn-cpp/c/util/ndn_realloc.c
index 8e560b9..f3147f4 100644
--- a/ndn-cpp/c/util/ndn_realloc.c
+++ b/ndn-cpp/c/util/ndn_realloc.c
@@ -7,7 +7,7 @@
 #include <stdlib.h>
 #include "ndn_realloc.h"
 
-uint8_t *ndn_realloc(struct ndn_DynamicUInt8Array *self, uint8_t *array, unsigned int length)
+uint8_t *ndn_realloc(struct ndn_DynamicUInt8Array *self, uint8_t *array, size_t length)
 {
   return (uint8_t *)realloc(array, length);
 }
diff --git a/ndn-cpp/c/util/ndn_realloc.h b/ndn-cpp/c/util/ndn_realloc.h
index 5259f70..7aeb6af 100644
--- a/ndn-cpp/c/util/ndn_realloc.h
+++ b/ndn-cpp/c/util/ndn_realloc.h
@@ -21,7 +21,7 @@
  * @param length the length for the new array buffer.
  * @return the new allocated array buffer.
  */
-uint8_t *ndn_realloc(struct ndn_DynamicUInt8Array *self, uint8_t *array, unsigned int length);
+uint8_t *ndn_realloc(struct ndn_DynamicUInt8Array *self, uint8_t *array, size_t length);
 
 #ifdef __cplusplus
 }
diff --git a/ndn-cpp/common.cpp b/ndn-cpp/common.cpp
index 70d3a90..fcebfba 100644
--- a/ndn-cpp/common.cpp
+++ b/ndn-cpp/common.cpp
@@ -19,7 +19,7 @@
   
   ostringstream result;
   result.flags(ios::hex | ios::uppercase);
-  for (unsigned int i = 0; i < array.size(); ++i) {
+  for (size_t i = 0; i < array.size(); ++i) {
     uint8_t x = array[i];
     if (x < 16)
       result << '0';
diff --git a/ndn-cpp/data.cpp b/ndn-cpp/data.cpp
index 5681159..1be361a 100644
--- a/ndn-cpp/data.cpp
+++ b/ndn-cpp/data.cpp
@@ -72,7 +72,7 @@
 SignedBlob 
 Data::wireEncode(WireFormat& wireFormat) 
 {
-  unsigned int signedPortionBeginOffset, signedPortionEndOffset;
+  size_t signedPortionBeginOffset, signedPortionEndOffset;
   Blob encoding = wireFormat.encodeData(*this, &signedPortionBeginOffset, &signedPortionEndOffset);
   
   wireEncoding_ = SignedBlob(encoding, signedPortionBeginOffset, signedPortionEndOffset);
@@ -80,9 +80,9 @@
 }
 
 void 
-Data::wireDecode(const uint8_t* input, unsigned int inputLength, WireFormat& wireFormat) 
+Data::wireDecode(const uint8_t* input, size_t inputLength, WireFormat& wireFormat) 
 {
-  unsigned int signedPortionBeginOffset, signedPortionEndOffset;
+  size_t signedPortionBeginOffset, signedPortionEndOffset;
   wireFormat.decodeData(*this, input, inputLength, &signedPortionBeginOffset, &signedPortionEndOffset);
   
   wireEncoding_ = SignedBlob(input, inputLength, signedPortionBeginOffset, signedPortionEndOffset);
diff --git a/ndn-cpp/data.hpp b/ndn-cpp/data.hpp
index 4b82fef..edb991b 100644
--- a/ndn-cpp/data.hpp
+++ b/ndn-cpp/data.hpp
@@ -101,7 +101,7 @@
   setFinalBlockID(const std::vector<uint8_t>& finalBlockID) { finalBlockID_ = Name::Component(finalBlockID); }
   
   void 
-  setFinalBlockID(const uint8_t* finalBlockID, unsigned int finalBlockIdLength) 
+  setFinalBlockID(const uint8_t* finalBlockID, size_t finalBlockIdLength) 
   { 
     finalBlockID_ = Name::Component(finalBlockID, finalBlockIdLength); 
   }
@@ -142,7 +142,7 @@
    * @param wireFormat A WireFormat object used to decode the input. If omitted, use WireFormat getDefaultWireFormat().
    */
   void 
-  wireDecode(const uint8_t* input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat());
+  wireDecode(const uint8_t* input, size_t inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat());
   
   /**
    * Decode the input using a particular wire format and update this Data. Also, set the wireEncoding field to the input.
@@ -257,7 +257,7 @@
   }
   
   void 
-  setContent(const uint8_t* content, unsigned int contentLength) 
+  setContent(const uint8_t* content, size_t contentLength) 
   { 
     content_ = Blob(content, contentLength); 
     onChanged();
diff --git a/ndn-cpp/encoding/binary-xml-decoder.hpp b/ndn-cpp/encoding/binary-xml-decoder.hpp
index 1bbca34..f75d4f0 100644
--- a/ndn-cpp/encoding/binary-xml-decoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-decoder.hpp
@@ -22,7 +22,7 @@
   /**
    * Initialize the base ndn_BinaryXmlDecoder struct with the input.
    */
-  BinaryXmlDecoder(const uint8_t *input, unsigned int inputLength) 
+  BinaryXmlDecoder(const uint8_t *input, size_t inputLength) 
   {
     ndn_BinaryXmlDecoder_initialize(this, (uint8_t *)input, inputLength);
   }
diff --git a/ndn-cpp/encoding/binary-xml-element-reader.cpp b/ndn-cpp/encoding/binary-xml-element-reader.cpp
index bfb9a2a..559af7f 100644
--- a/ndn-cpp/encoding/binary-xml-element-reader.cpp
+++ b/ndn-cpp/encoding/binary-xml-element-reader.cpp
@@ -9,7 +9,7 @@
 namespace ndn {
 
 void 
-ElementListener::staticOnReceivedElement(struct ndn_ElementListener *self, uint8_t *element, unsigned int elementLength)
+ElementListener::staticOnReceivedElement(struct ndn_ElementListener *self, uint8_t *element, size_t elementLength)
 {
   ((ElementListener *)self)->onReceivedElement(element, elementLength);
 }
diff --git a/ndn-cpp/encoding/binary-xml-element-reader.hpp b/ndn-cpp/encoding/binary-xml-element-reader.hpp
index 5aed8a0..f353e97 100644
--- a/ndn-cpp/encoding/binary-xml-element-reader.hpp
+++ b/ndn-cpp/encoding/binary-xml-element-reader.hpp
@@ -29,7 +29,7 @@
    * @param elementLength length of element
    */
   virtual void 
-  onReceivedElement(const uint8_t *element, unsigned int elementLength) = 0;
+  onReceivedElement(const uint8_t *element, size_t elementLength) = 0;
   
 private:
   /**
@@ -39,7 +39,7 @@
    * @param elementLength
    */
   static void 
-  staticOnReceivedElement(struct ndn_ElementListener *self, uint8_t *element, unsigned int elementLength);
+  staticOnReceivedElement(struct ndn_ElementListener *self, uint8_t *element, size_t elementLength);
 };
 
 }
diff --git a/ndn-cpp/encoding/binary-xml-structure-decoder.hpp b/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
index 0fbc1cf..e953a1b 100644
--- a/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
@@ -31,7 +31,7 @@
    * @return true if found the element end, false if need to read more. (This is the same as returning gotElementEnd().)
    */
   bool 
-  findElementEnd(uint8_t *input, unsigned int inputLength) 
+  findElementEnd(uint8_t *input, size_t inputLength) 
   {
     ndn_Error error;
     if ((error = ndn_BinaryXmlStructureDecoder_findElementEnd(this, input, inputLength)))
@@ -39,7 +39,7 @@
     return gotElementEnd();
   }
   
-  unsigned int 
+  size_t 
   getOffset() const { return offset; }
   
   bool 
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.cpp b/ndn-cpp/encoding/binary-xml-wire-format.cpp
index 130412c..adb756a 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.cpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.cpp
@@ -46,7 +46,7 @@
 }
 
 void 
-BinaryXmlWireFormat::decodeInterest(Interest& interest, const uint8_t *input, unsigned int inputLength)
+BinaryXmlWireFormat::decodeInterest(Interest& interest, const uint8_t *input, size_t inputLength)
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_ExcludeEntry excludeEntries[100];
@@ -64,7 +64,7 @@
 }
 
 Blob 
-BinaryXmlWireFormat::encodeData(const Data& data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset) 
+BinaryXmlWireFormat::encodeData(const Data& data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset) 
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_NameComponent keyNameComponents[100];
@@ -84,7 +84,7 @@
 
 void 
 BinaryXmlWireFormat::decodeData
-  (Data& data, const uint8_t *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset)
+  (Data& data, const uint8_t *input, size_t inputLength, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset)
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_NameComponent keyNameComponents[100];
@@ -119,7 +119,7 @@
 }
 
 void 
-BinaryXmlWireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, unsigned int inputLength)
+BinaryXmlWireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, size_t inputLength)
 {
   struct ndn_NameComponent prefixNameComponents[100];
   struct ndn_ForwardingEntry forwardingEntryStruct;
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.hpp b/ndn-cpp/encoding/binary-xml-wire-format.hpp
index de1388e..c169669 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.hpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.hpp
@@ -32,7 +32,7 @@
    * @param inputLength The number of bytes in input.
    */
   virtual void 
-  decodeInterest(Interest& interest, const uint8_t *input, unsigned int inputLength);
+  decodeInterest(Interest& interest, const uint8_t *input, size_t inputLength);
 
   /**
    * Encode data with binary XML and return the encoding.
@@ -45,7 +45,7 @@
    */
   virtual Blob 
   encodeData
-    (const Data& data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
+    (const Data& data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
   
   /**
    * Decode input as a data packet in binary XML and set the fields in the data object.
@@ -54,14 +54,14 @@
    * @param inputLength The number of bytes in input.
    * @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 uint8_t *input, unsigned int inputLength) to ignore this returned value.
+   * decodeData(Data& data, const uint8_t *input, size_t inputLength) to ignore this returned value.
    * @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 uint8_t *input, unsigned int inputLength) to ignore this returned value.
+   * decodeData(Data& data, const uint8_t *input, size_t inputLength) to ignore this returned value.
    */  
   virtual void 
   decodeData
-    (Data& data, const uint8_t *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
+    (Data& data, const uint8_t *input, size_t inputLength, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
 
   /**
    * Encode forwardingEntry in binary XML and return the encoding. 
@@ -78,7 +78,7 @@
    * @param inputLength The number of bytes in input.
    */
   virtual void 
-  decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, unsigned int inputLength);
+  decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, size_t inputLength);
 };
   
 }
diff --git a/ndn-cpp/encoding/wire-format.cpp b/ndn-cpp/encoding/wire-format.cpp
index 70644ad..cf7890e 100644
--- a/ndn-cpp/encoding/wire-format.cpp
+++ b/ndn-cpp/encoding/wire-format.cpp
@@ -35,20 +35,20 @@
 }
 
 void 
-WireFormat::decodeInterest(Interest& interest, const uint8_t *input, unsigned int inputLength) 
+WireFormat::decodeInterest(Interest& interest, const uint8_t *input, size_t inputLength) 
 {
   throw logic_error("unimplemented");
 }
 
 Blob 
-WireFormat::encodeData(const Data& data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset) 
+WireFormat::encodeData(const Data& data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset) 
 {
   throw logic_error("unimplemented");
 }
 
 void 
 WireFormat::decodeData
-  (Data& data, const uint8_t *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset) 
+  (Data& data, const uint8_t *input, size_t inputLength, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset) 
 {
   throw logic_error("unimplemented");
 }
@@ -60,7 +60,7 @@
 }
 
 void 
-WireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, unsigned int inputLength) 
+WireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, size_t inputLength) 
 {
   throw logic_error("unimplemented");
 }
diff --git a/ndn-cpp/encoding/wire-format.hpp b/ndn-cpp/encoding/wire-format.hpp
index 489415b..c5b4c6e 100644
--- a/ndn-cpp/encoding/wire-format.hpp
+++ b/ndn-cpp/encoding/wire-format.hpp
@@ -35,7 +35,7 @@
    * @throw logic_error for unimplemented if the derived class does not override.
    */
   virtual void 
-  decodeInterest(Interest& interest, const uint8_t *input, unsigned int inputLength);
+  decodeInterest(Interest& interest, const uint8_t *input, size_t inputLength);
 
   /**
    * Encode data and return the encoding.  Your derived class should override.
@@ -49,7 +49,7 @@
    */
   virtual Blob 
   encodeData
-    (const Data& data, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
+    (const Data& data, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
 
   /**
    * Encode data and return the encoding.
@@ -60,7 +60,7 @@
   Blob 
   encodeData(const Data& data)
   {
-    unsigned int dummyBeginOffset, dummyEndOffset;
+    size_t dummyBeginOffset, dummyEndOffset;
     return encodeData(data, &dummyBeginOffset, &dummyEndOffset);
   }
 
@@ -71,20 +71,20 @@
    * @param inputLength The number of bytes in input.
    * @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 uint8_t *input, unsigned int inputLength) to ignore this returned value.
+   * decodeData(Data& data, const uint8_t *input, size_t inputLength) to ignore this returned value.
    * @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 uint8_t *input, unsigned int inputLength) to ignore this returned value.
+   * decodeData(Data& data, const uint8_t *input, size_t inputLength) to ignore this returned value.
    * @throw logic_error for unimplemented if the derived class does not override.
    */  
   virtual void 
   decodeData
-    (Data& data, const uint8_t *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
+    (Data& data, const uint8_t *input, size_t inputLength, size_t *signedPortionBeginOffset, size_t *signedPortionEndOffset);
 
   void 
-  decodeData(Data& data, const uint8_t *input, unsigned int inputLength)
+  decodeData(Data& data, const uint8_t *input, size_t inputLength)
   {
-    unsigned int dummyBeginOffset, dummyEndOffset;
+    size_t dummyBeginOffset, dummyEndOffset;
     decodeData(data, input, inputLength, &dummyBeginOffset, &dummyEndOffset);
   }
   
@@ -105,7 +105,7 @@
    * @throw logic_error for unimplemented if the derived class does not override.
    */
   virtual void 
-  decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, unsigned int inputLength);
+  decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, size_t inputLength);
 
   /**
    * Set the static default WireFormat used by default encoding and decoding methods.
diff --git a/ndn-cpp/forwarding-entry.hpp b/ndn-cpp/forwarding-entry.hpp
index 73a9484..6884a08 100644
--- a/ndn-cpp/forwarding-entry.hpp
+++ b/ndn-cpp/forwarding-entry.hpp
@@ -39,7 +39,7 @@
   }
   
   void 
-  wireDecode(const uint8_t *input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
+  wireDecode(const uint8_t *input, size_t inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
   {
     wireFormat.decodeForwardingEntry(*this, input, inputLength);
   }
diff --git a/ndn-cpp/interest.cpp b/ndn-cpp/interest.cpp
index 0a736dc..dff002c 100644
--- a/ndn-cpp/interest.cpp
+++ b/ndn-cpp/interest.cpp
@@ -19,7 +19,7 @@
     throw runtime_error("excludeStruct.maxEntries must be >= this exclude getEntryCount()");
   
   excludeStruct.nEntries = entries_.size();
-  for (unsigned int i = 0; i < excludeStruct.nEntries; ++i)
+  for (size_t i = 0; i < excludeStruct.nEntries; ++i)
     entries_[i].get(excludeStruct.entries[i]);  
 }
 
@@ -27,7 +27,7 @@
 Exclude::set(const struct ndn_Exclude& excludeStruct)
 {
   entries_.clear();
-  for (unsigned int i = 0; i < excludeStruct.nEntries; ++i) {
+  for (size_t i = 0; i < excludeStruct.nEntries; ++i) {
     ndn_ExcludeEntry *entry = &excludeStruct.entries[i];
     
     if (entry->type == ndn_Exclude_COMPONENT)
diff --git a/ndn-cpp/interest.hpp b/ndn-cpp/interest.hpp
index 0f59a28..de4f00e 100644
--- a/ndn-cpp/interest.hpp
+++ b/ndn-cpp/interest.hpp
@@ -29,7 +29,7 @@
   /**
    * Create an ExcludeEntry of type ndn_Exclude_COMPONENT
    */
-  ExcludeEntry(uint8_t *component, unsigned int componentLen) 
+  ExcludeEntry(uint8_t *component, size_t componentLen) 
   : type_(ndn_Exclude_COMPONENT), component_(component, componentLen)
   {
   }
@@ -67,13 +67,13 @@
   Exclude() {
   }
   
-  unsigned int 
+  size_t 
   getEntryCount() const {
     return entries_.size();
   }
   
   const ExcludeEntry& 
-  getEntry(unsigned int i) const { return entries_[i]; }
+  getEntry(size_t i) const { return entries_[i]; }
   
   /**
    * Set the excludeStruct to point to the entries in this Exclude, without copying any memory.
@@ -103,7 +103,7 @@
    * Add a new entry of type ndn_Exclude_COMPONENT, copying from component of length compnentLength
    */
   void 
-  addComponent(uint8_t *component, unsigned int componentLen) 
+  addComponent(uint8_t *component, size_t componentLen) 
   {
     entries_.push_back(ExcludeEntry(component, componentLen));
   }
@@ -175,7 +175,7 @@
   }
   
   void 
-  wireDecode(const uint8_t *input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
+  wireDecode(const uint8_t *input, size_t inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
   {
     wireFormat.decodeInterest(*this, input, inputLength);
   }
diff --git a/ndn-cpp/key.hpp b/ndn-cpp/key.hpp
index da9a11f..6bfd779 100644
--- a/ndn-cpp/key.hpp
+++ b/ndn-cpp/key.hpp
@@ -68,7 +68,7 @@
   setKeyData(const std::vector<uint8_t>& keyData) { keyData_ = keyData; }
   
   void 
-  setKeyData(const uint8_t *keyData, unsigned int keyDataLength) 
+  setKeyData(const uint8_t *keyData, size_t keyDataLength) 
   { 
     keyData_ = Blob(keyData, keyDataLength); 
   }
diff --git a/ndn-cpp/name.cpp b/ndn-cpp/name.cpp
index 7534ba3..03b6168 100644
--- a/ndn-cpp/name.cpp
+++ b/ndn-cpp/name.cpp
@@ -87,7 +87,7 @@
 {
   ostringstream result;
   
-  for (unsigned int i = 0; i < str.size(); ++i) {
+  for (size_t i = 0; i < str.size(); ++i) {
     if (str[i] == '%' && i + 2 < str.size()) {
       int hi = fromHexChar(str[i + 1]);
       int lo = fromHexChar(str[i + 2]);
@@ -110,7 +110,7 @@
 }
 
 Blob 
-Name::Component::makeFromEscapedString(const char *escapedString, unsigned int beginOffset, unsigned int endOffset)
+Name::Component::makeFromEscapedString(const char *escapedString, size_t beginOffset, size_t endOffset)
 {
   string trimmedString(escapedString + beginOffset, escapedString + endOffset);
   trim(trimmedString);
@@ -212,7 +212,7 @@
     throw runtime_error("nameStruct.maxComponents must be >= this name getNComponents()");
   
   nameStruct.nComponents = components_.size();
-  for (unsigned int i = 0; i < nameStruct.nComponents; ++i)
+  for (size_t i = 0; i < nameStruct.nComponents; ++i)
     components_[i].get(nameStruct.components[i]);
 }
   
@@ -220,7 +220,7 @@
 Name::set(const struct ndn_Name& nameStruct) 
 {
   clear();
-  for (unsigned int i = 0; i < nameStruct.nComponents; ++i)
+  for (size_t i = 0; i < nameStruct.nComponents; ++i)
     addComponent(nameStruct.components[i].value, nameStruct.components[i].valueLength);  
 }
 
@@ -244,7 +244,7 @@
     return "/";
   
   ostringstream result;
-  for (unsigned int i = 0; i < components_.size(); ++i) {
+  for (size_t i = 0; i < components_.size(); ++i) {
     result << "/";
     toEscapedString(*components_[i].getValue(), result);
   }
@@ -257,8 +257,8 @@
 {
   Name result;
   
-  unsigned int iEnd = iStartComponent + nComponents;
-  for (unsigned int i = iStartComponent; i < iEnd && i < components_.size(); ++i)
+  size_t iEnd = iStartComponent + nComponents;
+  for (size_t i = iStartComponent; i < iEnd && i < components_.size(); ++i)
     result.components_.push_back(components_[i]);
   
   return result;
@@ -269,7 +269,7 @@
 {
   Name result;
   
-  for (unsigned int i = iStartComponent; i < components_.size(); ++i)
+  for (size_t i = iStartComponent; i < components_.size(); ++i)
     result.components_.push_back(components_[i]);
   
   return result;
@@ -285,7 +285,7 @@
     return 0;
 
 	// Check if at least one of given components doesn't match.
-  unsigned int i;
+  size_t i;
   for (i = 0; i < components_.size(); ++i) {
     const Component &selfComponent = components_[i];
     const Component &nameComponent = name.components_[i];
@@ -310,14 +310,14 @@
   if (!gotNonDot) {
     // Special case for component of zero or more periods.  Add 3 periods.
     result << "...";
-    for (unsigned int i = 0; i < value.size(); ++i)
+    for (size_t i = 0; i < value.size(); ++i)
       result << '.';
   }
   else {
     // In case we need to escape, set to upper case hex and save the previous flags.
     ios::fmtflags saveFlags = result.flags(ios::hex | ios::uppercase);
     
-    for (unsigned int i = 0; i < value.size(); ++i) {
+    for (size_t i = 0; i < value.size(); ++i) {
       uint8_t x = value[i];
       // Check for 0-9, A-Z, a-z, (+), (-), (.), (_)
       if (x >= 0x30 && x <= 0x39 || x >= 0x41 && x <= 0x5a ||
diff --git a/ndn-cpp/name.hpp b/ndn-cpp/name.hpp
index 7e9be6c..f39d568 100644
--- a/ndn-cpp/name.hpp
+++ b/ndn-cpp/name.hpp
@@ -44,7 +44,7 @@
      * @param value Pointer to the value byte array.
      * @param valueLen Length of value.
      */
-    Component(const uint8_t *value, unsigned int valueLen) 
+    Component(const uint8_t *value, size_t valueLen) 
     : value_(value, valueLen)
     {
     }
@@ -109,7 +109,7 @@
      * @return The component value as a Blob, or a Blob with a null pointer if escapedString is not a valid escaped component.
      */
     static Blob 
-    makeFromEscapedString(const char *escapedString, unsigned int beginOffset, unsigned int endOffset);
+    makeFromEscapedString(const char *escapedString, size_t beginOffset, size_t endOffset);
     
     /**
      * Make a component as the encoded segment number.
@@ -174,7 +174,7 @@
    * @return This name so that you can chain calls to append.
    */
   Name& 
-  append(const uint8_t *value, unsigned int valueLength) 
+  append(const uint8_t *value, size_t valueLength) 
   {
     components_.push_back(Component(value, valueLength));
     return *this;
@@ -210,7 +210,7 @@
    * @deprecated Use append.
    */
   Name& 
-  appendComponent(const uint8_t *value, unsigned int valueLength) 
+  appendComponent(const uint8_t *value, size_t valueLength) 
   {
     return append(value, valueLength);
   }
@@ -237,7 +237,7 @@
    * @deprecated Use append.
    */
   Name& 
-  addComponent(const uint8_t *value, unsigned int valueLength) 
+  addComponent(const uint8_t *value, size_t valueLength) 
   {
     return append(value, valueLength);
   }
@@ -272,13 +272,13 @@
    * Get the number of components.
    * @return The number of components.
    */
-  unsigned int 
+  size_t 
   getComponentCount() const {
     return components_.size();
   }
   
   const Component& 
-  getComponent(unsigned int i) const { return components_[i]; }
+  getComponent(size_t i) const { return components_[i]; }
   
   /**
    * Get a new name, constructed as a subset of components.
diff --git a/ndn-cpp/node.cpp b/ndn-cpp/node.cpp
index 6eb30fd..15e3b4d 100644
--- a/ndn-cpp/node.cpp
+++ b/ndn-cpp/node.cpp
@@ -102,7 +102,7 @@
   if (!success)
     throw std::runtime_error("Error in RSA_sign");
   
-  signature->setSignature(signatureBits, signatureBitsLength);
+  signature->setSignature(signatureBits, (size_t)signatureBitsLength);
 }
 
 // Use gettimeofday to return the current time in milliseconds.
@@ -224,7 +224,7 @@
 }
 
 void 
-Node::onReceivedElement(const uint8_t *element, unsigned int elementLength)
+Node::onReceivedElement(const uint8_t *element, size_t elementLength)
 {
   BinaryXmlDecoder decoder(element, elementLength);
   
@@ -269,7 +269,7 @@
   
   int iResult = -1;
     
-	for (unsigned int i = 0; i < pit_.size(); ++i) {
+	for (size_t i = 0; i < pit_.size(); ++i) {
 		if (ndn_Interest_matchesName((struct ndn_Interest *)&pit_[i]->getInterestStruct(), &nameStruct)) {
       if (iResult < 0 || 
           pit_[i]->getInterestStruct().name.nComponents > pit_[iResult]->getInterestStruct().name.nComponents)
@@ -286,7 +286,7 @@
 {
   int iResult = -1;
     
-	for (unsigned int i = 0; i < registeredPrefixTable_.size(); ++i) {
+	for (size_t i = 0; i < registeredPrefixTable_.size(); ++i) {
 		if (registeredPrefixTable_[i]->getPrefix()->match(name)) {
       if (iResult < 0 || 
           registeredPrefixTable_[i]->getPrefix()->getComponentCount() > registeredPrefixTable_[iResult]->getPrefix()->getComponentCount())
diff --git a/ndn-cpp/node.hpp b/ndn-cpp/node.hpp
index eba6eb5..a9bd81f 100644
--- a/ndn-cpp/node.hpp
+++ b/ndn-cpp/node.hpp
@@ -90,7 +90,7 @@
   getConnectionInfo() { return connectionInfo_; }
 
   void 
-  onReceivedElement(const uint8_t *element, unsigned int elementLength);
+  onReceivedElement(const uint8_t *element, size_t elementLength);
   
   void 
   shutdown();
diff --git a/ndn-cpp/publisher-public-key-digest.hpp b/ndn-cpp/publisher-public-key-digest.hpp
index 6abe8bd..1c04b3a 100644
--- a/ndn-cpp/publisher-public-key-digest.hpp
+++ b/ndn-cpp/publisher-public-key-digest.hpp
@@ -58,7 +58,7 @@
   }
   
   void 
-  setPublisherPublicKeyDigest(const uint8_t *publisherPublicKeyDigest, unsigned int publisherPublicKeyDigestLength) 
+  setPublisherPublicKeyDigest(const uint8_t *publisherPublicKeyDigest, size_t publisherPublicKeyDigestLength) 
   { 
     publisherPublicKeyDigest_ = Blob(publisherPublicKeyDigest, publisherPublicKeyDigestLength); 
   }
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)
diff --git a/ndn-cpp/sha256-with-rsa-signature.hpp b/ndn-cpp/sha256-with-rsa-signature.hpp
index 93bae74..2d5c4ce 100644
--- a/ndn-cpp/sha256-with-rsa-signature.hpp
+++ b/ndn-cpp/sha256-with-rsa-signature.hpp
@@ -65,7 +65,7 @@
   setDigestAlgorithm(const std::vector<uint8_t>& digestAlgorithm) { digestAlgorithm_ = digestAlgorithm; }
   
   void 
-  setDigestAlgorithm(const uint8_t *digestAlgorithm, unsigned int digestAlgorithmLength) 
+  setDigestAlgorithm(const uint8_t *digestAlgorithm, size_t digestAlgorithmLength) 
   { 
     digestAlgorithm_ = Blob(digestAlgorithm, digestAlgorithmLength); 
   }
@@ -74,7 +74,7 @@
   setWitness(const std::vector<uint8_t>& witness) { witness_ = witness; }
   
   void 
-  setWitness(const uint8_t *witness, unsigned int witnessLength) 
+  setWitness(const uint8_t *witness, size_t witnessLength) 
   { 
     witness_ = Blob(witness, witnessLength); 
   }
@@ -83,7 +83,7 @@
   setSignature(const std::vector<uint8_t>& signature) { signature_ = signature; }
   
   void 
-  setSignature(const uint8_t *signature, unsigned int signatureLength) 
+  setSignature(const uint8_t *signature, size_t signatureLength) 
   { 
     signature_ = Blob(signature, signatureLength); 
   }
diff --git a/ndn-cpp/transport/tcp-transport.cpp b/ndn-cpp/transport/tcp-transport.cpp
index 553c5c7..9a712fb 100644
--- a/ndn-cpp/transport/tcp-transport.cpp
+++ b/ndn-cpp/transport/tcp-transport.cpp
@@ -27,7 +27,7 @@
     throw std::runtime_error(ndn_getErrorString(error)); 
 
   // TODO: This belongs in the socket listener.
-  const unsigned int initialLength = 1000;
+  const size_t initialLength = 1000;
   // Automatically cast elementReader_ to (struct ndn_ElementListener *)
   ndn_BinaryXmlElementReader_initialize
     (&elementReader_, &elementListener, (uint8_t *)malloc(initialLength), initialLength, ndn_realloc);
@@ -37,7 +37,7 @@
 }
 
 void 
-TcpTransport::send(const uint8_t *data, unsigned int dataLength)
+TcpTransport::send(const uint8_t *data, size_t dataLength)
 {
   ndn_Error error;
   if ((error = ndn_TcpTransport_send(&transport_, (uint8_t *)data, dataLength)))
@@ -55,7 +55,7 @@
     return;
 
   uint8_t buffer[8000];
-  unsigned int nBytes;
+  size_t nBytes;
   if ((error = ndn_TcpTransport_receive(&transport_, buffer, sizeof(buffer), &nBytes)))
     throw std::runtime_error(ndn_getErrorString(error));  
 
diff --git a/ndn-cpp/transport/tcp-transport.hpp b/ndn-cpp/transport/tcp-transport.hpp
index d999df8..594f007 100644
--- a/ndn-cpp/transport/tcp-transport.hpp
+++ b/ndn-cpp/transport/tcp-transport.hpp
@@ -72,7 +72,7 @@
    * @param data A pointer to the buffer of data to send.
    * @param dataLength The number of bytes in data.
    */
-  virtual void send(const uint8_t *data, unsigned int dataLength);
+  virtual void send(const uint8_t *data, size_t dataLength);
 
   /**
    * Process any data to receive.  For each element received, call elementListener.onReceivedElement.
diff --git a/ndn-cpp/transport/transport.cpp b/ndn-cpp/transport/transport.cpp
index 4b8aca1..b36b119 100644
--- a/ndn-cpp/transport/transport.cpp
+++ b/ndn-cpp/transport/transport.cpp
@@ -22,7 +22,7 @@
 }
   
 void 
-Transport::send(const uint8_t *data, unsigned int dataLength)
+Transport::send(const uint8_t *data, size_t dataLength)
 {
   throw logic_error("unimplemented");
 }
diff --git a/ndn-cpp/transport/transport.hpp b/ndn-cpp/transport/transport.hpp
index ed3e240..512a003 100644
--- a/ndn-cpp/transport/transport.hpp
+++ b/ndn-cpp/transport/transport.hpp
@@ -37,7 +37,7 @@
    * @param dataLength The number of bytes in data.
    */
   virtual void 
-  send(const uint8_t *data, unsigned int dataLength);
+  send(const uint8_t *data, size_t dataLength);
   
   void 
   send(const std::vector<uint8_t>& data)
diff --git a/ndn-cpp/transport/udp-transport.cpp b/ndn-cpp/transport/udp-transport.cpp
index 0b2f397..4e65375 100644
--- a/ndn-cpp/transport/udp-transport.cpp
+++ b/ndn-cpp/transport/udp-transport.cpp
@@ -27,7 +27,7 @@
     throw std::runtime_error(ndn_getErrorString(error)); 
 
   // TODO: This belongs in the socket listener.
-  const unsigned int initialLength = 1000;
+  const size_t initialLength = 1000;
   // Automatically cast elementReader_ to (struct ndn_ElementListener *)
   ndn_BinaryXmlElementReader_initialize
     (&elementReader_, &elementListener, (uint8_t *)malloc(initialLength), initialLength, ndn_realloc);
@@ -37,7 +37,7 @@
 }
 
 void 
-UdpTransport::send(const uint8_t *data, unsigned int dataLength)
+UdpTransport::send(const uint8_t *data, size_t dataLength)
 {
   ndn_Error error;
   if ((error = ndn_UdpTransport_send(&transport_, (uint8_t *)data, dataLength)))
@@ -55,7 +55,7 @@
     return;
 
   uint8_t buffer[8000];
-  unsigned int nBytes;
+  size_t nBytes;
   if ((error = ndn_UdpTransport_receive(&transport_, buffer, sizeof(buffer), &nBytes)))
     throw std::runtime_error(ndn_getErrorString(error));  
 
diff --git a/ndn-cpp/transport/udp-transport.hpp b/ndn-cpp/transport/udp-transport.hpp
index b2374df..633b9ad 100644
--- a/ndn-cpp/transport/udp-transport.hpp
+++ b/ndn-cpp/transport/udp-transport.hpp
@@ -74,7 +74,7 @@
    * @param dataLength The number of bytes in data.
    */
   virtual void 
-  send(const uint8_t *data, unsigned int dataLength);
+  send(const uint8_t *data, size_t dataLength);
 
   /**
    * Process any data to receive.  For each element received, call elementListener.onReceivedElement.
diff --git a/ndn-cpp/util/blob.hpp b/ndn-cpp/util/blob.hpp
index d71808d..ef13433 100644
--- a/ndn-cpp/util/blob.hpp
+++ b/ndn-cpp/util/blob.hpp
@@ -35,7 +35,7 @@
    * @param value A pointer to the byte array which is copied.
    * @param valueLength The length of value.
    */
-  Blob(const uint8_t* value, unsigned int valueLength)
+  Blob(const uint8_t* value, size_t valueLength)
   : ptr_lib::shared_ptr<const std::vector<uint8_t> >(new std::vector<uint8_t>(value, value + valueLength))
   {
   }
@@ -68,7 +68,7 @@
   /**
    * Return the length of the immutable byte array.
    */
-  unsigned int 
+  size_t 
   size() const
   {
     if (*this)
diff --git a/ndn-cpp/util/changed-event.cpp b/ndn-cpp/util/changed-event.cpp
index 1d12c75..63b4569 100644
--- a/ndn-cpp/util/changed-event.cpp
+++ b/ndn-cpp/util/changed-event.cpp
@@ -13,7 +13,7 @@
 void 
 ChangedEvent::fire()
 {
-  for (unsigned int i = 0; i < listeners_.size(); ++i)
+  for (size_t i = 0; i < listeners_.size(); ++i)
     listeners_[i]();
 }
 
diff --git a/ndn-cpp/util/dynamic-uint8-vector.cpp b/ndn-cpp/util/dynamic-uint8-vector.cpp
index 240baa6..ae1b621 100644
--- a/ndn-cpp/util/dynamic-uint8-vector.cpp
+++ b/ndn-cpp/util/dynamic-uint8-vector.cpp
@@ -10,14 +10,14 @@
 
 namespace ndn {
 
-DynamicUInt8Vector::DynamicUInt8Vector(unsigned int initialLength)
+DynamicUInt8Vector::DynamicUInt8Vector(size_t initialLength)
 : vector_(new vector<uint8_t>(initialLength))
 {
   ndn_DynamicUInt8Array_initialize(this, &vector_->front(), initialLength, DynamicUInt8Vector::realloc);
 }
 
 uint8_t*
-DynamicUInt8Vector::realloc(struct ndn_DynamicUInt8Array *self, uint8_t *array, unsigned int length)
+DynamicUInt8Vector::realloc(struct ndn_DynamicUInt8Array *self, uint8_t *array, size_t length)
 {
   // Because this method is private, assume there is not a problem with upcasting.
   DynamicUInt8Vector *thisObject = (DynamicUInt8Vector *)self;
diff --git a/ndn-cpp/util/dynamic-uint8-vector.hpp b/ndn-cpp/util/dynamic-uint8-vector.hpp
index 2c6247e..9550899 100644
--- a/ndn-cpp/util/dynamic-uint8-vector.hpp
+++ b/ndn-cpp/util/dynamic-uint8-vector.hpp
@@ -23,7 +23,7 @@
    * Create a new DynamicUInt8Vector with an initial length.
    * @param initialLength The initial size of the allocated vector.
    */
-  DynamicUInt8Vector(unsigned int initialLength);
+  DynamicUInt8Vector(size_t initialLength);
   
   /**
    * Get the shared_ptr to the allocated vector.
@@ -41,7 +41,7 @@
    * @return The front of the allocated vector.
    */
   static uint8_t*
-  realloc(struct ndn_DynamicUInt8Array *self, uint8_t *array, unsigned int length);
+  realloc(struct ndn_DynamicUInt8Array *self, uint8_t *array, size_t length);
   
   ptr_lib::shared_ptr<std::vector<uint8_t> > vector_;
 };
diff --git a/ndn-cpp/util/signed-blob.hpp b/ndn-cpp/util/signed-blob.hpp
index 62e6ee2..dd94ae0 100644
--- a/ndn-cpp/util/signed-blob.hpp
+++ b/ndn-cpp/util/signed-blob.hpp
@@ -34,7 +34,7 @@
    * @param signedPortionEndOffset The offset in the encoding of the end of the signed portion.
    */
   SignedBlob
-    (const uint8_t* value, unsigned int valueLength, unsigned int signedPortionBeginOffset, unsigned int signedPortionEndOffset)
+    (const uint8_t* value, size_t valueLength, size_t signedPortionBeginOffset, size_t signedPortionEndOffset)
   : Blob(value, valueLength), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
   {
   }
@@ -48,7 +48,7 @@
    * @param signedPortionEndOffset The offset in the encoding of the end of the signed portion.
    */
   SignedBlob
-    (const std::vector<uint8_t> &value, unsigned int signedPortionBeginOffset, unsigned int signedPortionEndOffset)
+    (const std::vector<uint8_t> &value, size_t signedPortionBeginOffset, size_t signedPortionEndOffset)
   : Blob(value), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
   {
   }
@@ -62,13 +62,13 @@
    */
   SignedBlob
     (const ptr_lib::shared_ptr<std::vector<uint8_t> > &value, 
-     unsigned int signedPortionBeginOffset, unsigned int signedPortionEndOffset)
+     size_t signedPortionBeginOffset, size_t signedPortionEndOffset)
   : Blob(value), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
   {
   }
   SignedBlob
     (const ptr_lib::shared_ptr<const std::vector<uint8_t> > &value, 
-     unsigned int signedPortionBeginOffset, unsigned int signedPortionEndOffset)
+     size_t signedPortionBeginOffset, size_t signedPortionEndOffset)
   : Blob(value), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
   {
   }
@@ -76,7 +76,7 @@
   /**
    * Return the length of the signed portion of the immutable byte array, or 0 of the pointer to the array is null.
    */
-  unsigned int 
+  size_t 
   signedSize() const
   {
     if (*this)
@@ -101,18 +101,18 @@
   /**
    * Return the offset in the array of the beginning of the signed portion.
    */  
-  unsigned int 
+  size_t 
   getSignedPortionBeginOffset() { return signedPortionBeginOffset_; }
 
   /**
    * Return the offset in the array of the end of the signed portion.
    */  
-  unsigned int 
+  size_t 
   getSignedPortionEndOffset() { return signedPortionEndOffset_; }
   
 private:
-  unsigned int signedPortionBeginOffset_;
-  unsigned int signedPortionEndOffset_;
+  size_t signedPortionBeginOffset_;
+  size_t signedPortionEndOffset_;
 };
 
 }
diff --git a/tests/test-encode-decode-data.cpp b/tests/test-encode-decode-data.cpp
index 744ac06..5e09399 100644
--- a/tests/test-encode-decode-data.cpp
+++ b/tests/test-encode-decode-data.cpp
@@ -121,7 +121,7 @@
   cout << "name: " << data.getName().to_uri() << endl;
   if (data.getContent().size() > 0) {
     cout << "content (raw): ";
-    for (unsigned int i = 0; i < data.getContent().size(); ++i)
+    for (size_t i = 0; i < data.getContent().size(); ++i)
       cout << (*data.getContent())[i];
     cout<< endl;
     cout << "content (hex): " << toHex(*data.getContent()) << endl;
diff --git a/tests/test-get-async.cpp b/tests/test-get-async.cpp
index a50c34e..cbc8b97 100644
--- a/tests/test-get-async.cpp
+++ b/tests/test-get-async.cpp
@@ -29,7 +29,7 @@
   {
     ++callbackCount_;
     cout << "Got data packet with name " << data->getName().to_uri() << endl;
-    for (unsigned int i = 0; i < data->getContent().size(); ++i)
+    for (size_t i = 0; i < data->getContent().size(); ++i)
       cout << (*data->getContent())[i];
     cout << endl;  
   }
