diff --git a/ndn-cpp/c/data.h b/ndn-cpp/c/data.h
index 44d345e..81489f5 100644
--- a/ndn-cpp/c/data.h
+++ b/ndn-cpp/c/data.h
@@ -19,12 +19,12 @@
  * An ndn_Signature struct holds the signature bits and other info representing the signature in a data packet.
  */
 struct ndn_Signature {
-  unsigned char *digestAlgorithm;      /**< pointer to pre-allocated buffer.  0 for none.
+  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 */
-  unsigned char *witness;              /**< pointer to pre-allocated buffer.  0 for none. */
+  uint8_t *witness;              /**< pointer to pre-allocated buffer.  0 for none. */
   unsigned int witnessLength;          /**< length of witness.  0 for none */
-  unsigned char *signature;
+  uint8_t *signature;
   unsigned int signatureLength;
   struct ndn_PublisherPublicKeyDigest publisherPublicKeyDigest;
   struct ndn_KeyLocator keyLocator;
@@ -81,7 +81,7 @@
   struct ndn_Signature signature;
   struct ndn_Name name;
   struct ndn_MetaInfo metaInfo;
-  unsigned char *content;     /**< pointer to the content */
+  uint8_t *content;     /**< pointer to the content */
   unsigned int contentLength; /**< length of content */
 };
 
diff --git a/ndn-cpp/c/encoding/binary-xml-data.c b/ndn-cpp/c/encoding/binary-xml-data.c
index de34f9d..98dde11 100644
--- a/ndn-cpp/c/encoding/binary-xml-data.c
+++ b/ndn-cpp/c/encoding/binary-xml-data.c
@@ -76,7 +76,7 @@
   
   if (!(metaInfo->type < 0 || metaInfo->type == ndn_ContentType_DATA)) {
     // Not the default of DATA, so we need to encode the type.
-    unsigned char *typeBytes;
+    uint8_t *typeBytes;
     unsigned int typeBytesLength = 3;
     if (metaInfo->type == ndn_ContentType_ENCR)
       typeBytes = "\x10\xD0\x91";
@@ -127,7 +127,7 @@
       (decoder, ndn_BinaryXml_DTag_Timestamp, &metaInfo->timestampMilliseconds))
     return error;
   
-  unsigned char *typeBytes;
+  uint8_t *typeBytes;
   unsigned int typeBytesLength;
   if ((error = ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
       (decoder, ndn_BinaryXml_DTag_Type, 0, &typeBytes, &typeBytesLength)))
diff --git a/ndn-cpp/c/encoding/binary-xml-decoder.c b/ndn-cpp/c/encoding/binary-xml-decoder.c
index 1ccaccc..4be2450 100644
--- a/ndn-cpp/c/encoding/binary-xml-decoder.c
+++ b/ndn-cpp/c/encoding/binary-xml-decoder.c
@@ -34,13 +34,13 @@
  * @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(unsigned char *value, unsigned int valueLength, unsigned int *resultOut)
+static ndn_Error parseUnsignedDecimalInt(uint8_t *value, unsigned int valueLength, unsigned int *resultOut)
 {
   unsigned int result = 0;
   
   unsigned int i;
   for (i = 0; i < valueLength; ++i) {
-    unsigned char digit = value[i];
+    uint8_t digit = value[i];
     if (!(digit >= '0' && digit <= '9'))
       return NDN_ERROR_element_of_value_is_not_a_decimal_digit;
 
@@ -140,7 +140,7 @@
 }
 
 ndn_Error ndn_BinaryXmlDecoder_readBinaryDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, unsigned char **value, unsigned int *valueLength)
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, unsigned int *valueLength)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(self, expectedTag)))
@@ -173,7 +173,7 @@
 }
 
 ndn_Error ndn_BinaryXmlDecoder_readOptionalBinaryDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, unsigned char **value, unsigned int *valueLength)
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, unsigned int *valueLength)
 {
   ndn_Error error;
   int gotExpectedTag;
@@ -192,7 +192,7 @@
 }
 
 ndn_Error ndn_BinaryXmlDecoder_readUDataDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, unsigned char **value, unsigned int *valueLength)
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, unsigned int *valueLength)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlDecoder_readElementStartDTag(self, expectedTag)))
@@ -213,7 +213,7 @@
 }
 
 ndn_Error ndn_BinaryXmlDecoder_readOptionalUDataDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, unsigned char **value, unsigned int *valueLength)
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, unsigned int *valueLength)
 {
   ndn_Error error;
   int gotExpectedTag;
@@ -234,7 +234,7 @@
 ndn_Error ndn_BinaryXmlDecoder_readUnsignedIntegerDTagElement
   (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, unsigned int *value)
 {
-  unsigned char *udataValue;
+  uint8_t *udataValue;
   unsigned int udataValueLength;
   ndn_Error error;
   if ((error = ndn_BinaryXmlDecoder_readUDataDTagElement(self, expectedTag, &udataValue, &udataValueLength)))
@@ -271,7 +271,7 @@
   (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, double *milliseconds)
 {
   ndn_Error error;
-  unsigned char *bytes;
+  uint8_t *bytes;
   unsigned int bytesLength;
   if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(self, expectedTag, 0, &bytes, &bytesLength)))
     return error;
@@ -299,7 +299,7 @@
   return NDN_ERROR_success;
 }
 
-double ndn_BinaryXmlDecoder_unsignedBigEndianToDouble(unsigned char *bytes, unsigned int bytesLength) 
+double ndn_BinaryXmlDecoder_unsignedBigEndianToDouble(uint8_t *bytes, unsigned int bytesLength) 
 {
   double result = 0.0;
   unsigned int i;
diff --git a/ndn-cpp/c/encoding/binary-xml-decoder.h b/ndn-cpp/c/encoding/binary-xml-decoder.h
index 3b58787..dfa9b97 100644
--- a/ndn-cpp/c/encoding/binary-xml-decoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-decoder.h
@@ -7,6 +7,7 @@
 #ifndef NDN_BINARYXMLDECODER_H
 #define NDN_BINARYXMLDECODER_H
 
+#include "../common.h"
 #include "../errors.h"
 
 #ifdef __cplusplus
@@ -14,12 +15,12 @@
 #endif
 
 struct ndn_BinaryXmlDecoder {
-  unsigned char *input;
+  uint8_t *input;
   unsigned int inputLength;
   unsigned int offset;
 };
 
-static inline void ndn_BinaryXmlDecoder_initialize(struct ndn_BinaryXmlDecoder *self, unsigned char *input, unsigned int inputLength) 
+static inline void ndn_BinaryXmlDecoder_initialize(struct ndn_BinaryXmlDecoder *self, uint8_t *input, unsigned int inputLength) 
 {
   self->input = input;
   self->inputLength = inputLength;
@@ -77,7 +78,7 @@
  * and the binary data is absent
  */
 ndn_Error ndn_BinaryXmlDecoder_readBinaryDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, unsigned char **value, unsigned int *valueLength);
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, unsigned int *valueLength);
 
 /**
  * Peek at the next element and if it is the expectedTag, call ndn_BinaryXmlDecoder_readBinaryDTagElement.
@@ -92,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, unsigned char **value, unsigned int *valueLength);
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, int allowNull, uint8_t **value, unsigned int *valueLength);
 
 /**
  * Decode the header from self's input starting at offset, expecting the type to be DTAG and the value to be expectedTag.
@@ -105,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, unsigned char **value, unsigned int *valueLength);
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, unsigned int *valueLength);
 
 /**
  * Peek at the next element and if it is the expectedTag, call ndn_BinaryXmlDecoder_readUDataDTagElement.
@@ -119,7 +120,7 @@
  * @return 0 for success, else an error code.
  */
 ndn_Error ndn_BinaryXmlDecoder_readOptionalUDataDTagElement
-  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, unsigned char **value, unsigned int *valueLength);
+  (struct ndn_BinaryXmlDecoder *self, unsigned int expectedTag, uint8_t **value, unsigned int *valueLength);
 
 /**
  * Decode the header from self's input starting at offset, expecting the type to be DTAG and the value to be expectedTag.
@@ -176,7 +177,7 @@
  * @param bytesLength the length of bytes
  * @return the result
  */
-double ndn_BinaryXmlDecoder_unsignedBigEndianToDouble(unsigned char *bytes, unsigned int bytesLength); 
+double ndn_BinaryXmlDecoder_unsignedBigEndianToDouble(uint8_t *bytes, unsigned int bytesLength); 
 
 /**
  * Set the offset into the input, used for the next read.
diff --git a/ndn-cpp/c/encoding/binary-xml-element-reader.c b/ndn-cpp/c/encoding/binary-xml-element-reader.c
index 837363c..51f635f 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, unsigned char *data, unsigned int dataLength)
+  (struct ndn_BinaryXmlElementReader *self, uint8_t *data, unsigned int dataLength)
 {
   // Process multiple objects in the data.
   while(1) {
@@ -21,7 +21,7 @@
       // Got the remainder of an element.  Report to the caller.
       if (self->usePartialData) {
         // We have partial data from a previous call, so append this data and point to partialData.
-        if ((error = ndn_DynamicUCharArray_set(&self->partialData, data, self->structureDecoder.offset, self->partialDataLength)))
+        if ((error = ndn_DynamicUInt8Array_set(&self->partialData, data, self->structureDecoder.offset, self->partialDataLength)))
           return error;
         self->partialDataLength += dataLength;
                 
@@ -50,7 +50,7 @@
         self->partialDataLength = 0;
       }
       
-      if ((error = ndn_DynamicUCharArray_set(&self->partialData, data, dataLength, self->partialDataLength)))
+      if ((error = ndn_DynamicUInt8Array_set(&self->partialData, data, dataLength, self->partialDataLength)))
         return error;
       self->partialDataLength += dataLength;
       
diff --git a/ndn-cpp/c/encoding/binary-xml-element-reader.h b/ndn-cpp/c/encoding/binary-xml-element-reader.h
index 666d15f..cb962cd 100644
--- a/ndn-cpp/c/encoding/binary-xml-element-reader.h
+++ b/ndn-cpp/c/encoding/binary-xml-element-reader.h
@@ -9,7 +9,7 @@
 
 #include "../errors.h"
 #include "binary-xml-structure-decoder.h"
-#include "../util/dynamic-uchar-array.h"
+#include "../util/dynamic-uint8-array.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -19,7 +19,7 @@
  * will be passed to onReceivedElement.
  */
 struct ndn_ElementListener {
-  void (*onReceivedElement)(struct ndn_ElementListener *self, unsigned char *element, unsigned int elementLength); /**< see ndn_ElementListener_initialize */
+  void (*onReceivedElement)(struct ndn_ElementListener *self, uint8_t *element, unsigned int 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, unsigned char *element, unsigned int elementLength))
+  (struct ndn_ElementListener *self, void (*onReceivedElement)(struct ndn_ElementListener *self, uint8_t *element, unsigned int elementLength))
 {
   self->onReceivedElement = onReceivedElement;
 }
@@ -44,7 +44,7 @@
   struct ndn_ElementListener *elementListener;
   struct ndn_BinaryXmlStructureDecoder structureDecoder;
   int usePartialData;
-  struct ndn_DynamicUCharArray partialData;
+  struct ndn_DynamicUInt8Array partialData;
   unsigned int partialDataLength;
 };
 
@@ -54,16 +54,16 @@
  * @param elementListener pointer to the ndn_ElementListener used by ndn_BinaryXmlElementReader_onReceivedData.
  * @param buffer the allocated buffer.  If reallocFunction is null, this should be large enough to save a full element, perhaps 8000 bytes.
  * @param bufferLength the length of the buffer
- * @param reallocFunction see ndn_DynamicUCharArray_ensureLength.  This may be 0.
+ * @param reallocFunction see ndn_DynamicUInt8Array_ensureLength.  This may be 0.
  */
 static inline void ndn_BinaryXmlElementReader_initialize
   (struct ndn_BinaryXmlElementReader *self, struct ndn_ElementListener *elementListener,
-   unsigned char *buffer, unsigned int bufferLength, unsigned char * (*reallocFunction)(struct ndn_DynamicUCharArray *self, unsigned char *, unsigned int))
+   uint8_t *buffer, unsigned int bufferLength, uint8_t * (*reallocFunction)(struct ndn_DynamicUInt8Array *self, uint8_t *, unsigned int))
 {
   self->elementListener = elementListener;
   ndn_BinaryXmlStructureDecoder_initialize(&self->structureDecoder);
   self->usePartialData = 0;
-  ndn_DynamicUCharArray_initialize(&self->partialData, buffer, bufferLength, reallocFunction);
+  ndn_DynamicUInt8Array_initialize(&self->partialData, buffer, bufferLength, reallocFunction);
 }
 
 /**
@@ -75,7 +75,7 @@
  * @return 0 for success, else an error code
  */
 ndn_Error ndn_BinaryXmlElementReader_onReceivedData
-  (struct ndn_BinaryXmlElementReader *self, unsigned char *data, unsigned int dataLength);
+  (struct ndn_BinaryXmlElementReader *self, uint8_t *data, unsigned int dataLength);
 
 #ifdef __cplusplus
 }
diff --git a/ndn-cpp/c/encoding/binary-xml-encoder.c b/ndn-cpp/c/encoding/binary-xml-encoder.c
index ae6eb26..fce9b2d 100644
--- a/ndn-cpp/c/encoding/binary-xml-encoder.c
+++ b/ndn-cpp/c/encoding/binary-xml-encoder.c
@@ -17,17 +17,17 @@
 };
 
 /**
- * Call ndn_DynamicUCharArray_ensureLength to ensure that there is enough room in the output, and copy
+ * Call ndn_DynamicUInt8Array_ensureLength to ensure that there is enough room in the output, and copy
  * array to the output.  This does not write a header.
  * @param self pointer to the ndn_BinaryXmlEncoder struct
  * @param array the array to copy
  * @param arrayLength the length of the array
  * @return 0 for success, else an error code
  */
-static ndn_Error writeArray(struct ndn_BinaryXmlEncoder *self, unsigned char *array, unsigned int arrayLength)
+static ndn_Error writeArray(struct ndn_BinaryXmlEncoder *self, uint8_t *array, unsigned int arrayLength)
 {
   ndn_Error error;
-  if ((error = ndn_DynamicUCharArray_ensureLength(self->output, self->offset + arrayLength)))
+  if ((error = ndn_DynamicUInt8Array_ensureLength(self->output, self->offset + arrayLength)))
     return error;
   
   ndn_memcpy(self->output->array + self->offset, array, arrayLength);
@@ -67,16 +67,16 @@
  * @param array
  * @param length
  */
-static void reverse(unsigned char *array, unsigned int length) 
+static void reverse(uint8_t *array, unsigned int length) 
 {
   if (length == 0)
     return;
   
-  unsigned char *left = array;
-  unsigned char *right = array + length - 1;
+  uint8_t *left = array;
+  uint8_t *right = array + length - 1;
   while (left < right) {
     // Swap.
-    unsigned char temp = *left;
+    uint8_t temp = *left;
     *left = *right;
     *right = temp;
     
@@ -86,7 +86,7 @@
 }
 
 /**
- * Write x as an unsigned decimal integer to the output with the digits in reverse order, using ndn_DynamicUCharArray_ensureLength.
+ * Write x as an unsigned decimal integer to the output with the digits in reverse order, using ndn_DynamicUInt8Array_ensureLength.
  * This does not write a header.
  * We encode in reverse order, because this is the natural way to encode the digits, and the caller can reverse as needed.
  * @param self pointer to the ndn_BinaryXmlEncoder struct
@@ -97,10 +97,10 @@
 {
   while (1) {
     ndn_Error error;
-    if ((error = ndn_DynamicUCharArray_ensureLength(self->output, self->offset + 1)))
+    if ((error = ndn_DynamicUInt8Array_ensureLength(self->output, self->offset + 1)))
       return error;
     
-    self->output->array[self->offset++] = (unsigned char)(x % 10 + '0');
+    self->output->array[self->offset++] = (uint8_t)(x % 10 + '0');
     x /= 10;
     
     if (x == 0)
@@ -126,14 +126,14 @@
   unsigned int nBufferBytes = self->offset - startOffset;
   unsigned int nHeaderBytes = getNHeaderEncodingBytes(nBufferBytes);
   ndn_Error error;
-  if ((error = ndn_DynamicUCharArray_ensureLength(self->output, self->offset + nHeaderBytes)))
+  if ((error = ndn_DynamicUInt8Array_ensureLength(self->output, self->offset + nHeaderBytes)))
     return error;
   
   // To reverse and shift at the same time, we first shift nHeaderBytes to the destination while reversing,
   //   then reverse the remaining bytes in place.
-  unsigned char *from = self->output->array + startOffset;
-  unsigned char *fromEnd = from + nHeaderBytes;
-  unsigned char *to = self->output->array + startOffset + nBufferBytes + nHeaderBytes - 1;
+  uint8_t *from = self->output->array + startOffset;
+  uint8_t *fromEnd = from + nHeaderBytes;
+  uint8_t *to = self->output->array + startOffset + nBufferBytes + nHeaderBytes - 1;
   while (from < fromEnd)
     *(to--) = *(from++);
   // Reverse the remaining bytes in place (if any).
@@ -179,7 +179,7 @@
   // Encode backwards. Calculate how many bytes we need.
   unsigned int nEncodingBytes = getNHeaderEncodingBytes(value);
   ndn_Error error;
-  if ((error = ndn_DynamicUCharArray_ensureLength(self->output, self->offset + nEncodingBytes)))
+  if ((error = ndn_DynamicUInt8Array_ensureLength(self->output, self->offset + nEncodingBytes)))
     return error;
 
   // Bottom 4 bits of value go in last byte with tag.
@@ -208,7 +208,7 @@
 ndn_Error ndn_BinaryXmlEncoder_writeElementClose(struct ndn_BinaryXmlEncoder *self)
 {
   ndn_Error error;
-  if ((error = ndn_DynamicUCharArray_ensureLength(self->output, self->offset + 1)))
+  if ((error = ndn_DynamicUInt8Array_ensureLength(self->output, self->offset + 1)))
     return error;
   
   self->output->array[self->offset] = ndn_BinaryXml_CLOSE;
@@ -217,7 +217,7 @@
   return NDN_ERROR_success;
 }
 
-ndn_Error ndn_BinaryXmlEncoder_writeBlob(struct ndn_BinaryXmlEncoder *self, unsigned char *value, unsigned int valueLength)
+ndn_Error ndn_BinaryXmlEncoder_writeBlob(struct ndn_BinaryXmlEncoder *self, uint8_t *value, unsigned int 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, unsigned char *value, unsigned int valueLength)
+ndn_Error ndn_BinaryXmlEncoder_writeBlobDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, unsigned int 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, unsigned char *value, unsigned int valueLength)
+ndn_Error ndn_BinaryXmlEncoder_writeUData(struct ndn_BinaryXmlEncoder *self, uint8_t *value, unsigned int 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, unsigned char *value, unsigned int valueLength)
+ndn_Error ndn_BinaryXmlEncoder_writeUDataDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, unsigned int valueLength)
 {
   ndn_Error error;
   if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(self, tag)))
@@ -311,17 +311,17 @@
   
   ndn_Error error;
   while (lo32 != 0) {
-    if ((error = ndn_DynamicUCharArray_ensureLength(self->output, self->offset + 1)))
+    if ((error = ndn_DynamicUInt8Array_ensureLength(self->output, self->offset + 1)))
       return error;
     
-    self->output->array[self->offset++] = (unsigned char)(lo32 & 0xff);
+    self->output->array[self->offset++] = (uint8_t)(lo32 & 0xff);
     lo32 >>= 8;
   }
   
   if (hi32 != 0) {
     // Pad the lo values out to 4 bytes.
     while (self->offset - startOffset < 4) {
-      if ((error = ndn_DynamicUCharArray_ensureLength(self->output, self->offset + 1)))
+      if ((error = ndn_DynamicUInt8Array_ensureLength(self->output, self->offset + 1)))
         return error;
     
       self->output->array[self->offset++] = 0;
@@ -329,10 +329,10 @@
     
     // Encode hi32
     while (hi32 != 0) {
-      if ((error = ndn_DynamicUCharArray_ensureLength(self->output, self->offset + 1)))
+      if ((error = ndn_DynamicUInt8Array_ensureLength(self->output, self->offset + 1)))
         return error;
     
-      self->output->array[self->offset++] = (unsigned char)(hi32 & 0xff);
+      self->output->array[self->offset++] = (uint8_t)(hi32 & 0xff);
       hi32 >>= 8;
     }
   }
diff --git a/ndn-cpp/c/encoding/binary-xml-encoder.h b/ndn-cpp/c/encoding/binary-xml-encoder.h
index d56cc8a..3cf4a89 100644
--- a/ndn-cpp/c/encoding/binary-xml-encoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-encoder.h
@@ -8,7 +8,7 @@
 #define NDN_BINARYXMLENCODER_H
 
 #include "../errors.h"
-#include "../util/dynamic-uchar-array.h"
+#include "../util/dynamic-uint8-array.h"
 #include "binary-xml.h"
 
 #ifdef __cplusplus
@@ -19,18 +19,18 @@
  *  ndn_BinaryXmlEncoder_initialize.
  */
 struct ndn_BinaryXmlEncoder {
-  struct ndn_DynamicUCharArray *output; /**< A pointer to a ndn_DynamicUCharArray which receives the encoded output */
+  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 */
 };
 
 /**
- * Initialize an ndn_BinaryXmlEncoder_initialize struct with the arguments for initializing the ndn_DynamicUCharArray.
+ * Initialize an ndn_BinaryXmlEncoder_initialize struct with the arguments for initializing the ndn_DynamicUInt8Array.
  * @param self pointer to the ndn_BinaryXmlEncoder struct
- * @param output A pointer to a ndn_DynamicUCharArray struct which receives the encoded output.  The struct must
+ * @param output A pointer to a ndn_DynamicUInt8Array struct which receives the encoded output.  The struct must
  * remain valid during the entire life of this ndn_BinaryXmlEncoder. If the output->realloc
  * function pointer is null, its array must be large enough to receive the entire encoding.
  */
-static inline void ndn_BinaryXmlEncoder_initialize(struct ndn_BinaryXmlEncoder *self, struct ndn_DynamicUCharArray *output) 
+static inline void ndn_BinaryXmlEncoder_initialize(struct ndn_BinaryXmlEncoder *self, struct ndn_DynamicUInt8Array *output) 
 {
   self->output = output;
   self->offset = 0;
@@ -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, unsigned char *value, unsigned int valueLength);
+ndn_Error ndn_BinaryXmlEncoder_writeBlob(struct ndn_BinaryXmlEncoder *self, uint8_t *value, unsigned int 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, unsigned char *value, unsigned int valueLength);
+ndn_Error ndn_BinaryXmlEncoder_writeBlobDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, unsigned int 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, unsigned char *value, unsigned int valueLength)
+  (struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, unsigned int 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, unsigned char *value, unsigned int valueLength);
+ndn_Error ndn_BinaryXmlEncoder_writeUData(struct ndn_BinaryXmlEncoder *self, uint8_t *value, unsigned int 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, unsigned char *value, unsigned int valueLength);
+ndn_Error ndn_BinaryXmlEncoder_writeUDataDTagElement(struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, unsigned int 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, unsigned char *value, unsigned int valueLength)
+  (struct ndn_BinaryXmlEncoder *self, unsigned int tag, uint8_t *value, unsigned int valueLength)
 {
   if (value && valueLength > 0)
     return ndn_BinaryXmlEncoder_writeUDataDTagElement(self, tag, value, valueLength);
diff --git a/ndn-cpp/c/encoding/binary-xml-interest.c b/ndn-cpp/c/encoding/binary-xml-interest.c
index a1b51a6..ee20f05 100644
--- a/ndn-cpp/c/encoding/binary-xml-interest.c
+++ b/ndn-cpp/c/encoding/binary-xml-interest.c
@@ -60,7 +60,7 @@
       return error;    
     if (gotExpectedTag) {
       // Component
-      unsigned char *component;
+      uint8_t *component;
       unsigned int componentLen;
       if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement(decoder, ndn_BinaryXml_DTag_Component, 0, &component, &componentLen)))
         return error;
@@ -96,7 +96,7 @@
       return error;    
     if (gotExpectedTag) {
       // Skip the Bloom and treat it as Any.
-      unsigned char *value;
+      uint8_t *value;
       unsigned int 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 c6f55f7..f36e0ef 100644
--- a/ndn-cpp/c/encoding/binary-xml-name.c
+++ b/ndn-cpp/c/encoding/binary-xml-name.c
@@ -44,7 +44,7 @@
       // No more components.
       break;
     
-    unsigned char *component;
+    uint8_t *component;
     unsigned int 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 4596910..603d07d 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, unsigned char *input, unsigned int inputLength) 
+  (struct ndn_BinaryXmlStructureDecoder *self, uint8_t *input, unsigned int inputLength) 
 {
   if (self->gotElementEnd)
     // Someone is calling when we already got the end.
diff --git a/ndn-cpp/c/encoding/binary-xml-structure-decoder.h b/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
index e58471e..f8bf5d0 100644
--- a/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
@@ -7,6 +7,7 @@
 #ifndef NDN_BINARYXMLSTRUCTUREDECODER_H
 #define NDN_BINARYXMLSTRUCTUREDECODER_H
 
+#include "../common.h"
 #include "../errors.h"
 
 #ifdef __cplusplus
@@ -21,7 +22,7 @@
   unsigned int headerLength;
   int useHeaderBuffer; /**< boolean */
   // 10 bytes is enough to hold an encoded header with a type and a 64 bit value.
-  unsigned char headerBuffer[10];
+  uint8_t headerBuffer[10];
   int nBytesToRead;
 };
 
@@ -43,7 +44,7 @@
  * @return 0 for success, else an error code
  */
 ndn_Error ndn_BinaryXmlStructureDecoder_findElementEnd
-  (struct ndn_BinaryXmlStructureDecoder *self, unsigned char *input, unsigned int inputLength);
+  (struct ndn_BinaryXmlStructureDecoder *self, uint8_t *input, unsigned int inputLength);
 
 /**
  * Set the offset into the input, used for the next read.
diff --git a/ndn-cpp/c/errors.c b/ndn-cpp/c/errors.c
index 125be8a..5ccbec1 100644
--- a/ndn-cpp/c/errors.c
+++ b/ndn-cpp/c/errors.c
@@ -43,10 +43,10 @@
     return      "findElementEnd unrecognized header type";
   case NDN_ERROR_findElementEnd_unrecognized_state:
     return      "findElementEnd unrecognized state";
-  case NDN_ERROR_DynamicUCharArray_realloc_function_pointer_not_supplied:
-    return      "DynamicUCharArray realloc function pointer not supplied";
-  case NDN_ERROR_DynamicUCharArray_realloc_failed:
-    return      "DynamicUCharArray realloc failed";
+  case NDN_ERROR_DynamicUInt8Array_realloc_function_pointer_not_supplied:
+    return      "DynamicUInt8Array realloc function pointer not supplied";
+  case NDN_ERROR_DynamicUInt8Array_realloc_failed:
+    return      "DynamicUInt8Array realloc failed";
   case NDN_ERROR_unrecognized_ndn_ExcludeType:
     return      "unrecognized ndn_ExcludeType";
   case NDN_ERROR_unrecognized_ndn_ContentType:
diff --git a/ndn-cpp/c/errors.h b/ndn-cpp/c/errors.h
index 1254c0b..9f992f9 100644
--- a/ndn-cpp/c/errors.h
+++ b/ndn-cpp/c/errors.h
@@ -30,8 +30,8 @@
   NDN_ERROR_findElementEnd_cannot_read_header_type_and_value,
   NDN_ERROR_findElementEnd_unrecognized_header_type,
   NDN_ERROR_findElementEnd_unrecognized_state,
-  NDN_ERROR_DynamicUCharArray_realloc_function_pointer_not_supplied,
-  NDN_ERROR_DynamicUCharArray_realloc_failed,
+  NDN_ERROR_DynamicUInt8Array_realloc_function_pointer_not_supplied,
+  NDN_ERROR_DynamicUInt8Array_realloc_failed,
   NDN_ERROR_unrecognized_ndn_ExcludeType,
   NDN_ERROR_unrecognized_ndn_ContentType,
   NDN_ERROR_unrecognized_ndn_KeyLocatorType,
diff --git a/ndn-cpp/c/forwarding-entry.h b/ndn-cpp/c/forwarding-entry.h
index f28ce69..8a77e2f 100644
--- a/ndn-cpp/c/forwarding-entry.h
+++ b/ndn-cpp/c/forwarding-entry.h
@@ -7,6 +7,7 @@
 #ifndef NDN_FORWARDING_ENTRY_H
 #define NDN_FORWARDING_ENTRY_H
 
+#include "common.h"
 #include "name.h"
 #include "publisher-public-key-digest.h"
 
@@ -18,7 +19,7 @@
  * An ndn_ForwardingEntry holds fields for a ForwardingEntry which is used to register a prefix with a hub.
  */
 struct ndn_ForwardingEntry {
-  unsigned char *action;     /**< pointer to pre-allocated buffer.  0 for none. */
+  uint8_t *action;     /**< pointer to pre-allocated buffer.  0 for none. */
   unsigned int actionLength; /**< length of action.  0 for none. */
   struct ndn_Name prefix;
   struct ndn_PublisherPublicKeyDigest publisherPublicKeyDigest;
diff --git a/ndn-cpp/c/interest.h b/ndn-cpp/c/interest.h
index cda0598..ad1b700 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, unsigned char *component, unsigned int componentLength) 
+static inline void ndn_ExcludeEntry_initialize(struct ndn_ExcludeEntry *self, ndn_ExcludeType type, uint8_t *component, unsigned int componentLength) 
 {
   self->type = type;
   ndn_NameComponent_initialize(&self->component, component, componentLength);
@@ -102,7 +102,7 @@
   int answerOriginKind;     /**< -1 for none */
   int scope;                /**< -1 for none */
   double interestLifetimeMilliseconds; /**< milliseconds. -1.0 for none */
-  unsigned char *nonce;     /**< pointer to pre-allocated buffer.  0 for none */
+  uint8_t *nonce;     /**< pointer to pre-allocated buffer.  0 for none */
   unsigned int nonceLength; /**< length of nonce.  0 for none */
 };
 
diff --git a/ndn-cpp/c/key.h b/ndn-cpp/c/key.h
index fee3c64..2069789 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 */
-  unsigned char *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. 
diff --git a/ndn-cpp/c/name.h b/ndn-cpp/c/name.h
index ade193a..5415f6e 100644
--- a/ndn-cpp/c/name.h
+++ b/ndn-cpp/c/name.h
@@ -15,7 +15,7 @@
  * An ndn_NameComponent holds a pointer to the component value.
  */
 struct ndn_NameComponent {
-  unsigned char *value;     /**< pointer to the pre-allocated buffer for the component value */
+  uint8_t *value;     /**< pointer to the pre-allocated buffer for the component value */
   unsigned int 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, unsigned char *value, unsigned int valueLength) 
+static inline void ndn_NameComponent_initialize(struct ndn_NameComponent *self, uint8_t *value, unsigned int valueLength) 
 {
   self->value = value;
   self->valueLength = valueLength;
diff --git a/ndn-cpp/c/publisher-public-key-digest.h b/ndn-cpp/c/publisher-public-key-digest.h
index 0fcf032..3e02b9b 100644
--- a/ndn-cpp/c/publisher-public-key-digest.h
+++ b/ndn-cpp/c/publisher-public-key-digest.h
@@ -7,6 +7,8 @@
 #ifndef NDN_PUBLISHERPUBLICKEYDIGEST_H
 #define NDN_PUBLISHERPUBLICKEYDIGEST_H
 
+#include "common.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -16,7 +18,7 @@
  * We make a separate struct since this is used by multiple other structs.
  */
 struct ndn_PublisherPublicKeyDigest {
-  unsigned char *publisherPublicKeyDigest;      /**< pointer to pre-allocated buffer.  0 for none */
+  uint8_t *publisherPublicKeyDigest;      /**< pointer to pre-allocated buffer.  0 for none */
   unsigned int 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 53987b0..aef13ac 100644
--- a/ndn-cpp/c/transport/socket-transport.c
+++ b/ndn-cpp/c/transport/socket-transport.c
@@ -25,7 +25,7 @@
   }
   
   struct addrinfo hints;
-  ndn_memset((unsigned char *)&hints, 0, sizeof(hints));
+  ndn_memset((uint8_t *)&hints, 0, sizeof(hints));
   hints.ai_family = AF_UNSPEC;
   if (socketType == SOCKET_TCP)
     hints.ai_socktype = SOCK_STREAM;
@@ -67,7 +67,7 @@
   return NDN_ERROR_success;
 }
 
-ndn_Error ndn_SocketTransport_send(struct ndn_SocketTransport *self, unsigned char *data, unsigned int dataLength)
+ndn_Error ndn_SocketTransport_send(struct ndn_SocketTransport *self, uint8_t *data, unsigned int 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, unsigned char *buffer, unsigned int bufferLength, unsigned int *nBytesOut)
+  (struct ndn_SocketTransport *self, uint8_t *buffer, unsigned int bufferLength, unsigned int *nBytesOut)
 {
   if (self->socketDescriptor < 0)
     return NDN_ERROR_SocketTransport_socket_is_not_open;
diff --git a/ndn-cpp/c/transport/socket-transport.h b/ndn-cpp/c/transport/socket-transport.h
index 750cc56..e1388c3 100644
--- a/ndn-cpp/c/transport/socket-transport.h
+++ b/ndn-cpp/c/transport/socket-transport.h
@@ -8,6 +8,7 @@
 #define NDN_SOCKETTRANSPORT_H
 
 #include <sys/socket.h>
+#include "../common.h"
 #include "../errors.h"
 
 #ifdef __cplusplus
@@ -49,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, unsigned char *data, unsigned int dataLength);
+ndn_Error ndn_SocketTransport_send(struct ndn_SocketTransport *self, uint8_t *data, unsigned int dataLength);
 
 /**
  * Check if there is data ready on the socket to be received with ndn_SocketTransport_receive.
@@ -70,7 +71,7 @@
  * @return 0 for success, else an error code.
  */
 ndn_Error ndn_SocketTransport_receive
-  (struct ndn_SocketTransport *self, unsigned char *buffer, unsigned int bufferLength, unsigned int *nBytes);
+  (struct ndn_SocketTransport *self, uint8_t *buffer, unsigned int bufferLength, unsigned int *nBytes);
 
 /**
  * Close the socket.
diff --git a/ndn-cpp/c/transport/tcp-transport.h b/ndn-cpp/c/transport/tcp-transport.h
index e31e127..05902f9 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, unsigned char *data, unsigned int dataLength)
+static inline ndn_Error ndn_TcpTransport_send(struct ndn_TcpTransport *self, uint8_t *data, unsigned int 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, unsigned char *buffer, unsigned int bufferLength, unsigned int *nBytes)
+  (struct ndn_TcpTransport *self, uint8_t *buffer, unsigned int bufferLength, unsigned int *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 a97af10..fc9a173 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, unsigned char *data, unsigned int dataLength)
+static inline ndn_Error ndn_UdpTransport_send(struct ndn_UdpTransport *self, uint8_t *data, unsigned int 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, unsigned char *buffer, unsigned int bufferLength, unsigned int *nBytes)
+  (struct ndn_UdpTransport *self, uint8_t *buffer, unsigned int bufferLength, unsigned int *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 90e665b..4784065 100644
--- a/ndn-cpp/c/util/blob.h
+++ b/ndn-cpp/c/util/blob.h
@@ -15,7 +15,7 @@
  * An ndn_Blob holds a pointer to a read-only pre-allocated buffer and its length.
  */
 struct ndn_Blob {
-  unsigned char *value;     /**< pointer to the pre-allocated buffer for the value. Must be treated as read only. */
+  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. */
 };
 
@@ -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, unsigned char *value, unsigned int valueLength) 
+static inline void ndn_Blob_initialize(struct ndn_Blob *self, uint8_t *value, unsigned int valueLength) 
 {
   self->value = value;
   self->valueLength = valueLength;
diff --git a/ndn-cpp/c/util/crypto.c b/ndn-cpp/c/util/crypto.c
index 397a542..2cdc91b 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 unsigned char *data, unsigned int dataLength, unsigned char *digest)
+void ndn_digestSha256(const uint8_t *data, unsigned int 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 9dea5b0..eb7cec5 100644
--- a/ndn-cpp/c/util/crypto.h
+++ b/ndn-cpp/c/util/crypto.h
@@ -9,6 +9,7 @@
 
 #include <openssl/ssl.h>
 #include <openssl/rsa.h>
+#include "../common.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -20,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 unsigned char *data, unsigned int dataLength, unsigned char *digest);
+void ndn_digestSha256(const uint8_t *data, unsigned int dataLength, uint8_t *digest);
 
 #ifdef __cplusplus
 }
diff --git a/ndn-cpp/c/util/dynamic-uchar-array.c b/ndn-cpp/c/util/dynamic-uint8-array.c
similarity index 60%
rename from ndn-cpp/c/util/dynamic-uchar-array.c
rename to ndn-cpp/c/util/dynamic-uint8-array.c
index aa573e8..5a7e96d 100644
--- a/ndn-cpp/c/util/dynamic-uchar-array.c
+++ b/ndn-cpp/c/util/dynamic-uint8-array.c
@@ -4,12 +4,12 @@
  * See COPYING for copyright and distribution information.
  */
 
-#include "dynamic-uchar-array.h"
+#include "dynamic-uint8-array.h"
 
-ndn_Error ndn_DynamicUCharArray_reallocArray(struct ndn_DynamicUCharArray *self, unsigned int length)
+ndn_Error ndn_DynamicUInt8Array_reallocArray(struct ndn_DynamicUInt8Array *self, unsigned int length)
 {
   if (!self->realloc)
-    return NDN_ERROR_DynamicUCharArray_realloc_function_pointer_not_supplied;
+    return NDN_ERROR_DynamicUInt8Array_realloc_function_pointer_not_supplied;
   
   // See if double is enough.
   unsigned int newLength = self->length * 2;
@@ -17,9 +17,9 @@
     // The needed length is much greater, so use it.
     newLength = length;
     
-  unsigned char *newArray = (*self->realloc)(self, self->array, newLength);
+  uint8_t *newArray = (*self->realloc)(self, self->array, newLength);
   if (!newArray)
-    return NDN_ERROR_DynamicUCharArray_realloc_failed;
+    return NDN_ERROR_DynamicUInt8Array_realloc_failed;
   
   self->array = newArray;
   self->length = newLength;
diff --git a/ndn-cpp/c/util/dynamic-uchar-array.h b/ndn-cpp/c/util/dynamic-uint8-array.h
similarity index 62%
rename from ndn-cpp/c/util/dynamic-uchar-array.h
rename to ndn-cpp/c/util/dynamic-uint8-array.h
index 14f06e5..8b7b489 100644
--- a/ndn-cpp/c/util/dynamic-uchar-array.h
+++ b/ndn-cpp/c/util/dynamic-uint8-array.h
@@ -14,27 +14,27 @@
 extern "C" {
 #endif
 
-struct ndn_DynamicUCharArray {
-  unsigned char *array; /**< the allocated array buffer */
+struct ndn_DynamicUInt8Array {
+  uint8_t *array; /**< the allocated array buffer */
   unsigned int length;  /**< the length of the allocated array buffer */
-  unsigned char * (*realloc)
-    (struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length); /**< a pointer to a function that reallocates array and returns a new pointer to a buffer of
+  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
                                                                                       * 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_DynamicUCharArray which is calling realloc.
+                                                                                      * self is a pointer to the struct ndn_DynamicUInt8Array which is calling realloc.
                                                                                       * This function pointer may be 0 (which causes an error if a reallocate is necessary). */
 };
 
 /**
- * Initialize an ndn_DynamicUCharArray struct with the given array buffer.
- * @param self pointer to the ndn_DynamicUCharArray struct
+ * Initialize an ndn_DynamicUInt8Array struct with the given array buffer.
+ * @param self pointer to the ndn_DynamicUInt8Array struct
  * @param array the allocated array buffer
  * @param length the length of the allocated array buffer
- * @param reallocFunction see ndn_DynamicUCharArray_ensureLength.  This may be 0.
+ * @param reallocFunction see ndn_DynamicUInt8Array_ensureLength.  This may be 0.
  */
-static inline void ndn_DynamicUCharArray_initialize
-  (struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length, 
-   unsigned char * (*reallocFunction)(struct ndn_DynamicUCharArray *self, unsigned char *, unsigned int)) 
+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)) 
 {
   self->array = array;
   self->length = length;
@@ -42,44 +42,44 @@
 }
 
 /**
- * Do the work of ndn_DynamicUCharArray_ensureLength if realloc is necessary.
+ * Do the work of ndn_DynamicUInt8Array_ensureLength if realloc is necessary.
  * If the self->realloc function pointer is null, then return an error.
  * If not null, call self->realloc to reallocate self->array, and update self->length (which may be greater than length).
- * @param self pointer to the ndn_DynamicUCharArray struct
+ * @param self pointer to the ndn_DynamicUInt8Array struct
  * @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_DynamicUCharArray_reallocArray(struct ndn_DynamicUCharArray *self, unsigned int length);
+ndn_Error ndn_DynamicUInt8Array_reallocArray(struct ndn_DynamicUInt8Array *self, unsigned int length);
 
 /**
  * Ensure that self->length is greater than or equal to length.  If it is, just return 0 for success.
  * Otherwise, if the self->realloc function pointer is null, then return an error.
  * If not null, call self->realloc to reallocate self->array, and update self->length (which may be greater than length).
- * @param self pointer to the ndn_DynamicUCharArray struct
+ * @param self pointer to the ndn_DynamicUInt8Array struct
  * @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_DynamicUCharArray_ensureLength(struct ndn_DynamicUCharArray *self, unsigned int length) 
+static inline ndn_Error ndn_DynamicUInt8Array_ensureLength(struct ndn_DynamicUInt8Array *self, unsigned int length) 
 {
   if (self->length >= length)
     return NDN_ERROR_success;
 
-  return ndn_DynamicUCharArray_reallocArray(self, length);
+  return ndn_DynamicUInt8Array_reallocArray(self, length);
 }
 
 /**
- * Copy value into self->array at offset, using ndn_DynamicUCharArray_ensureLength to make sure self->array has enough length.
- * @param self pointer to the ndn_DynamicUCharArray struct
+ * Copy value into self->array at offset, using ndn_DynamicUInt8Array_ensureLength to make sure self->array has enough length.
+ * @param self pointer to the ndn_DynamicUInt8Array struct
  * @param value the buffer to copy from
  * @param valueLength the length of the value buffer
  * @param offset the offset in self->array to copy to
  * @return 0 for success, else an error code if need to reallocate the array but can't
  */
-static inline ndn_Error ndn_DynamicUCharArray_set
-  (struct ndn_DynamicUCharArray *self, unsigned char *value, unsigned int valueLength, unsigned int offset) 
+static inline ndn_Error ndn_DynamicUInt8Array_set
+  (struct ndn_DynamicUInt8Array *self, uint8_t *value, unsigned int valueLength, unsigned int offset) 
 {
   ndn_Error error;
-  if ((error = ndn_DynamicUCharArray_ensureLength(self, valueLength + offset)))
+  if ((error = ndn_DynamicUInt8Array_ensureLength(self, valueLength + offset)))
     return error;
   ndn_memcpy(self->array + offset, value, valueLength);
   return NDN_ERROR_success;
diff --git a/ndn-cpp/c/util/ndn_memory.c b/ndn-cpp/c/util/ndn_memory.c
index 863e886..db92bde 100644
--- a/ndn-cpp/c/util/ndn_memory.c
+++ b/ndn-cpp/c/util/ndn_memory.c
@@ -7,7 +7,7 @@
 #include "ndn_memory.h"
 
 #if !HAVE_MEMCMP
-int ndn_memcmp(unsigned char *buf1, unsigned char *buf2, unsigned int len)
+int ndn_memcmp(uint8_t *buf1, uint8_t *buf2, unsigned int len)
 {
   unsigned int i;
   
@@ -25,7 +25,7 @@
 #endif
 
 #if !HAVE_MEMCPY
-void ndn_memcpy(unsigned char *dest, unsigned char *src, unsigned int len)
+void ndn_memcpy(uint8_t *dest, uint8_t *src, unsigned int len)
 {
   unsigned int i;
   
@@ -37,12 +37,12 @@
 #endif
 
 #if !HAVE_MEMSET
-void ndn_memset(unsigned char *dest, int val, unsigned int len)
+void ndn_memset(uint8_t *dest, int val, unsigned int len)
 {
   unsigned int i;
   
   for (i = 0; i < len; i++)
-    dest[i] = (unsigned char)val;
+    dest[i] = (uint8_t)val;
 }
 #else
 int ndn_memset_stub_to_avoid_empty_file_warning = 0;
diff --git a/ndn-cpp/c/util/ndn_memory.h b/ndn-cpp/c/util/ndn_memory.h
index 85b01b3..ba0a85b 100644
--- a/ndn-cpp/c/util/ndn_memory.h
+++ b/ndn-cpp/c/util/ndn_memory.h
@@ -11,7 +11,7 @@
 #ifndef NDN_MEMORY_H
 #define NDN_MEMORY_H
 
-#include "../../../config.h"
+#include "../common.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -22,12 +22,12 @@
 /**
  * Use the library version of memcmp.
  */
-static inline int ndn_memcmp(unsigned char *buf1, unsigned char *buf2, unsigned int len) { return memcmp(buf1, buf2, len); }
+static inline int ndn_memcmp(uint8_t *buf1, uint8_t *buf2, unsigned int len) { return memcmp(buf1, buf2, len); }
 #else
 /**
  * Use a local implementation of memcmp instead of the library version.
  */
-int ndn_memcmp(unsigned char *buf1, unsigned char *buf2, unsigned int len);
+int ndn_memcmp(uint8_t *buf1, uint8_t *buf2, unsigned int len);
 #endif
 
 #if HAVE_MEMCPY
@@ -35,12 +35,12 @@
 /**
  * Use the library version of memcpy.
  */
-static inline void ndn_memcpy(unsigned char *dest, unsigned char *src, unsigned int len) { memcpy(dest, src, len); }
+static inline void ndn_memcpy(uint8_t *dest, uint8_t *src, unsigned int len) { memcpy(dest, src, len); }
 #else
 /**
  * Use a local implementation of memcpy instead of the library version.
  */
-void ndn_memcpy(unsigned char *dest, unsigned char *src, unsigned int len);
+void ndn_memcpy(uint8_t *dest, uint8_t *src, unsigned int len);
 #endif
 
 #if HAVE_MEMSET
@@ -48,12 +48,12 @@
 /**
  * Use the library version of memset.
  */
-static inline void ndn_memset(unsigned char *dest, int val, unsigned int len) { memset(dest, val, len); }
+static inline void ndn_memset(uint8_t *dest, int val, unsigned int len) { memset(dest, val, len); }
 #else
 /**
  * Use a local implementation of memset instead of the library version.
  */
-void ndn_memset(unsigned char *dest, int val, unsigned int len);
+void ndn_memset(uint8_t *dest, int val, unsigned int len);
 #endif
 
 #ifdef __cplusplus
diff --git a/ndn-cpp/c/util/ndn_realloc.c b/ndn-cpp/c/util/ndn_realloc.c
index bc701e0..8e560b9 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"
 
-unsigned char *ndn_realloc(struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length)
+uint8_t *ndn_realloc(struct ndn_DynamicUInt8Array *self, uint8_t *array, unsigned int length)
 {
-  return (unsigned char *)realloc(array, 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 07dd053..5259f70 100644
--- a/ndn-cpp/c/util/ndn_realloc.h
+++ b/ndn-cpp/c/util/ndn_realloc.h
@@ -7,21 +7,21 @@
 #ifndef NDN_NDN_REALLOC_H
 #define NDN_NDN_REALLOC_H
 
-#include "dynamic-uchar-array.h"
+#include "dynamic-uint8-array.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /**
- * Wrap the C stdlib realloc to convert to/from void * to unsigned char *.
- * This can be used by ndn_DynamicUCharArray_initialize.
+ * Wrap the C stdlib realloc to convert to/from void * to uint8_t *.
+ * This can be used by ndn_DynamicUInt8Array_initialize.
  * @param self This is ignored.
  * @param array the allocated array buffer to realloc.
  * @param length the length for the new array buffer.
  * @return the new allocated array buffer.
  */
-unsigned char *ndn_realloc(struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length);
+uint8_t *ndn_realloc(struct ndn_DynamicUInt8Array *self, uint8_t *array, unsigned int length);
 
 #ifdef __cplusplus
 }
diff --git a/ndn-cpp/common.cpp b/ndn-cpp/common.cpp
index d1c55f3..70d3a90 100644
--- a/ndn-cpp/common.cpp
+++ b/ndn-cpp/common.cpp
@@ -12,7 +12,7 @@
 namespace ndn {
 
 string 
-toHex(const vector<unsigned char>& array) 
+toHex(const vector<uint8_t>& array) 
 {
   if (!&array)
     return "";
@@ -20,7 +20,7 @@
   ostringstream result;
   result.flags(ios::hex | ios::uppercase);
   for (unsigned int i = 0; i < array.size(); ++i) {
-    unsigned char x = array[i];
+    uint8_t x = array[i];
     if (x < 16)
       result << '0';
     result << (unsigned int)x;
diff --git a/ndn-cpp/common.hpp b/ndn-cpp/common.hpp
index 0ed219c..70b36ed 100644
--- a/ndn-cpp/common.hpp
+++ b/ndn-cpp/common.hpp
@@ -58,7 +58,7 @@
  * @return Hex string.
  */
 std::string 
-toHex(const std::vector<unsigned char>& array);
+toHex(const std::vector<uint8_t>& array);
 
 }
 
diff --git a/ndn-cpp/data.cpp b/ndn-cpp/data.cpp
index 684a061..5681159 100644
--- a/ndn-cpp/data.cpp
+++ b/ndn-cpp/data.cpp
@@ -53,7 +53,7 @@
   
   dataStruct.contentLength = content_.size();
   if (content_.size() > 0)
-    dataStruct.content = (unsigned char*)content_.buf();
+    dataStruct.content = (uint8_t*)content_.buf();
   else
     dataStruct.content = 0;
 }
@@ -80,7 +80,7 @@
 }
 
 void 
-Data::wireDecode(const unsigned char* input, unsigned int inputLength, WireFormat& wireFormat) 
+Data::wireDecode(const uint8_t* input, unsigned int inputLength, WireFormat& wireFormat) 
 {
   unsigned int signedPortionBeginOffset, signedPortionEndOffset;
   wireFormat.decodeData(*this, input, inputLength, &signedPortionBeginOffset, &signedPortionEndOffset);
diff --git a/ndn-cpp/data.hpp b/ndn-cpp/data.hpp
index e8434b4..4b82fef 100644
--- a/ndn-cpp/data.hpp
+++ b/ndn-cpp/data.hpp
@@ -98,10 +98,10 @@
   setFreshnessSeconds(int freshnessSeconds) { freshnessSeconds_ = freshnessSeconds; }
   
   void 
-  setFinalBlockID(const std::vector<unsigned char>& finalBlockID) { finalBlockID_ = Name::Component(finalBlockID); }
+  setFinalBlockID(const std::vector<uint8_t>& finalBlockID) { finalBlockID_ = Name::Component(finalBlockID); }
   
   void 
-  setFinalBlockID(const unsigned char* finalBlockID, unsigned int finalBlockIdLength) 
+  setFinalBlockID(const uint8_t* finalBlockID, unsigned int 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 unsigned char* input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat());
+  wireDecode(const uint8_t* input, unsigned int 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.
@@ -150,7 +150,7 @@
    * @param wireFormat A WireFormat object used to decode the input. If omitted, use WireFormat getDefaultWireFormat().
    */
   void 
-  wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
+  wireDecode(const std::vector<uint8_t>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
   {
     wireDecode(&input[0], input.size(), wireFormat);
   }
@@ -250,14 +250,14 @@
    * @param content A vector whose contents are copied.
    */
   void 
-  setContent(const std::vector<unsigned char>& content) 
+  setContent(const std::vector<uint8_t>& content) 
   { 
     content_ = content; 
     onChanged();
   }
   
   void 
-  setContent(const unsigned char* content, unsigned int contentLength) 
+  setContent(const uint8_t* content, unsigned int contentLength) 
   { 
     content_ = Blob(content, contentLength); 
     onChanged();
@@ -269,14 +269,14 @@
    * @param content A pointer to a vector with the byte array.  This takes another reference and does not copy the bytes.
    */
   void 
-  setContent(const ptr_lib::shared_ptr<std::vector<unsigned char> > &content) 
+  setContent(const ptr_lib::shared_ptr<std::vector<uint8_t> > &content) 
   { 
     content_ = content;
     onChanged();
   }
   
   void 
-  setContent(const ptr_lib::shared_ptr<const std::vector<unsigned char> > &content) 
+  setContent(const ptr_lib::shared_ptr<const std::vector<uint8_t> > &content) 
   { 
     content_ = content;
     onChanged();
diff --git a/ndn-cpp/encoding/binary-xml-decoder.hpp b/ndn-cpp/encoding/binary-xml-decoder.hpp
index 7b28e7f..1bbca34 100644
--- a/ndn-cpp/encoding/binary-xml-decoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-decoder.hpp
@@ -22,9 +22,9 @@
   /**
    * Initialize the base ndn_BinaryXmlDecoder struct with the input.
    */
-  BinaryXmlDecoder(const unsigned char *input, unsigned int inputLength) 
+  BinaryXmlDecoder(const uint8_t *input, unsigned int inputLength) 
   {
-    ndn_BinaryXmlDecoder_initialize(this, (unsigned char *)input, 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 6a7c5ad..bfb9a2a 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, unsigned char *element, unsigned int elementLength)
+ElementListener::staticOnReceivedElement(struct ndn_ElementListener *self, uint8_t *element, unsigned int 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 c86b99a..5aed8a0 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 unsigned char *element, unsigned int elementLength) = 0;
+  onReceivedElement(const uint8_t *element, unsigned int elementLength) = 0;
   
 private:
   /**
@@ -39,7 +39,7 @@
    * @param elementLength
    */
   static void 
-  staticOnReceivedElement(struct ndn_ElementListener *self, unsigned char *element, unsigned int elementLength);
+  staticOnReceivedElement(struct ndn_ElementListener *self, uint8_t *element, unsigned int elementLength);
 };
 
 }
diff --git a/ndn-cpp/encoding/binary-xml-encoder.hpp b/ndn-cpp/encoding/binary-xml-encoder.hpp
index 7c7f626..af495ca 100644
--- a/ndn-cpp/encoding/binary-xml-encoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-encoder.hpp
@@ -9,7 +9,7 @@
 
 #include <vector>
 #include "../common.hpp"
-#include "../util/dynamic-uchar-vector.hpp"
+#include "../util/dynamic-uint8-vector.hpp"
 #include "../c/encoding/binary-xml-encoder.h"
 
 namespace ndn {
@@ -32,14 +32,14 @@
    * Resize the output vector to the correct encoding length and return.
    * @return The encoding as a shared_ptr.  Assume that the caller now owns the vector.
    */
-  const ptr_lib::shared_ptr<std::vector<unsigned char> >& 
+  const ptr_lib::shared_ptr<std::vector<uint8_t> >& 
   getOutput() 
   {
     output_.get()->resize(offset);
     return output_.get();
   }
   
-  DynamicUCharVector output_;
+  DynamicUInt8Vector output_;
 };
 
 }
diff --git a/ndn-cpp/encoding/binary-xml-structure-decoder.hpp b/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
index a1911ea..0fbc1cf 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(unsigned char *input, unsigned int inputLength) 
+  findElementEnd(uint8_t *input, unsigned int inputLength) 
   {
     ndn_Error error;
     if ((error = ndn_BinaryXmlStructureDecoder_findElementEnd(this, input, inputLength)))
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.cpp b/ndn-cpp/encoding/binary-xml-wire-format.cpp
index 71f74d5..130412c 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 unsigned char *input, unsigned int inputLength)
+BinaryXmlWireFormat::decodeInterest(Interest& interest, const uint8_t *input, unsigned int inputLength)
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_ExcludeEntry excludeEntries[100];
@@ -84,7 +84,7 @@
 
 void 
 BinaryXmlWireFormat::decodeData
-  (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset)
+  (Data& data, const uint8_t *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset)
 {
   struct ndn_NameComponent nameComponents[100];
   struct ndn_NameComponent keyNameComponents[100];
@@ -119,7 +119,7 @@
 }
 
 void 
-BinaryXmlWireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int inputLength)
+BinaryXmlWireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, unsigned int 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 350561e..de1388e 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 unsigned char *input, unsigned int inputLength);
+  decodeInterest(Interest& interest, const uint8_t *input, unsigned int inputLength);
 
   /**
    * Encode data with binary XML and return the encoding.
@@ -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 unsigned char *input, unsigned int inputLength) to ignore this returned value.
+   * decodeData(Data& data, const uint8_t *input, unsigned int 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 unsigned char *input, unsigned int inputLength) to ignore this returned value.
+   * decodeData(Data& data, const uint8_t *input, unsigned int inputLength) to ignore this returned value.
    */  
   virtual void 
   decodeData
-    (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
+    (Data& data, const uint8_t *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *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 unsigned char *input, unsigned int inputLength);
+  decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, unsigned int inputLength);
 };
   
 }
diff --git a/ndn-cpp/encoding/wire-format.cpp b/ndn-cpp/encoding/wire-format.cpp
index 41c1f39..70644ad 100644
--- a/ndn-cpp/encoding/wire-format.cpp
+++ b/ndn-cpp/encoding/wire-format.cpp
@@ -35,7 +35,7 @@
 }
 
 void 
-WireFormat::decodeInterest(Interest& interest, const unsigned char *input, unsigned int inputLength) 
+WireFormat::decodeInterest(Interest& interest, const uint8_t *input, unsigned int inputLength) 
 {
   throw logic_error("unimplemented");
 }
@@ -48,7 +48,7 @@
 
 void 
 WireFormat::decodeData
-  (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset) 
+  (Data& data, const uint8_t *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset) 
 {
   throw logic_error("unimplemented");
 }
@@ -60,7 +60,7 @@
 }
 
 void 
-WireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const unsigned char *input, unsigned int inputLength) 
+WireFormat::decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, unsigned int inputLength) 
 {
   throw logic_error("unimplemented");
 }
diff --git a/ndn-cpp/encoding/wire-format.hpp b/ndn-cpp/encoding/wire-format.hpp
index 02e7a8c..489415b 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 unsigned char *input, unsigned int inputLength);
+  decodeInterest(Interest& interest, const uint8_t *input, unsigned int inputLength);
 
   /**
    * Encode data and return the encoding.  Your derived class should override.
@@ -71,18 +71,18 @@
    * @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 unsigned char *input, unsigned int inputLength) to ignore this returned value.
+   * decodeData(Data& data, const uint8_t *input, unsigned int 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 unsigned char *input, unsigned int inputLength) to ignore this returned value.
+   * decodeData(Data& data, const uint8_t *input, unsigned int inputLength) to ignore this returned value.
    * @throw logic_error for unimplemented if the derived class does not override.
    */  
   virtual void 
   decodeData
-    (Data& data, const unsigned char *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
+    (Data& data, const uint8_t *input, unsigned int inputLength, unsigned int *signedPortionBeginOffset, unsigned int *signedPortionEndOffset);
 
   void 
-  decodeData(Data& data, const unsigned char *input, unsigned int inputLength)
+  decodeData(Data& data, const uint8_t *input, unsigned int inputLength)
   {
     unsigned int 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 unsigned char *input, unsigned int inputLength);
+  decodeForwardingEntry(ForwardingEntry& forwardingEntry, const uint8_t *input, unsigned int inputLength);
 
   /**
    * Set the static default WireFormat used by default encoding and decoding methods.
diff --git a/ndn-cpp/forwarding-entry.cpp b/ndn-cpp/forwarding-entry.cpp
index 7311e3c..57c01c4 100644
--- a/ndn-cpp/forwarding-entry.cpp
+++ b/ndn-cpp/forwarding-entry.cpp
@@ -38,7 +38,7 @@
 
   forwardingEntryStruct.actionLength = action_.size();
   if (action_.size() > 0)
-    forwardingEntryStruct.action = (unsigned char *)&action_[0];
+    forwardingEntryStruct.action = (uint8_t *)&action_[0];
   else
     forwardingEntryStruct.action = 0;
 }
diff --git a/ndn-cpp/forwarding-entry.hpp b/ndn-cpp/forwarding-entry.hpp
index 3c88a89..73a9484 100644
--- a/ndn-cpp/forwarding-entry.hpp
+++ b/ndn-cpp/forwarding-entry.hpp
@@ -39,13 +39,13 @@
   }
   
   void 
-  wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
+  wireDecode(const uint8_t *input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
   {
     wireFormat.decodeForwardingEntry(*this, input, inputLength);
   }
   
   void 
-  wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
+  wireDecode(const std::vector<uint8_t>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
   {
     wireDecode(&input[0], input.size(), wireFormat);
   }
diff --git a/ndn-cpp/interest.cpp b/ndn-cpp/interest.cpp
index 3c09234..0a736dc 100644
--- a/ndn-cpp/interest.cpp
+++ b/ndn-cpp/interest.cpp
@@ -91,7 +91,7 @@
 
   interestStruct.nonceLength = nonce_.size();
   if (nonce_.size() > 0)
-    interestStruct.nonce = (unsigned char *)nonce_.buf();
+    interestStruct.nonce = (uint8_t *)nonce_.buf();
   else
     interestStruct.nonce = 0;
 }
diff --git a/ndn-cpp/interest.hpp b/ndn-cpp/interest.hpp
index 749363f..0f59a28 100644
--- a/ndn-cpp/interest.hpp
+++ b/ndn-cpp/interest.hpp
@@ -29,7 +29,7 @@
   /**
    * Create an ExcludeEntry of type ndn_Exclude_COMPONENT
    */
-  ExcludeEntry(unsigned char *component, unsigned int componentLen) 
+  ExcludeEntry(uint8_t *component, unsigned int componentLen) 
   : type_(ndn_Exclude_COMPONENT), component_(component, componentLen)
   {
   }
@@ -103,7 +103,7 @@
    * Add a new entry of type ndn_Exclude_COMPONENT, copying from component of length compnentLength
    */
   void 
-  addComponent(unsigned char *component, unsigned int componentLen) 
+  addComponent(uint8_t *component, unsigned int componentLen) 
   {
     entries_.push_back(ExcludeEntry(component, componentLen));
   }
@@ -133,7 +133,7 @@
 public:    
   Interest(const Name& name, int minSuffixComponents, int maxSuffixComponents, 
     const PublisherPublicKeyDigest& publisherPublicKeyDigest, const Exclude& exclude, int childSelector, int answerOriginKind, 
-    int scope, double interestLifetimeMilliseconds, const std::vector<unsigned char>& nonce) 
+    int scope, double interestLifetimeMilliseconds, const std::vector<uint8_t>& nonce) 
   : name_(name), minSuffixComponents_(minSuffixComponents), maxSuffixComponents_(maxSuffixComponents),
   publisherPublicKeyDigest_(publisherPublicKeyDigest), exclude_(exclude), childSelector_(childSelector), 
   answerOriginKind_(answerOriginKind), scope_(scope), interestLifetimeMilliseconds_(interestLifetimeMilliseconds),
@@ -175,13 +175,13 @@
   }
   
   void 
-  wireDecode(const unsigned char *input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
+  wireDecode(const uint8_t *input, unsigned int inputLength, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
   {
     wireFormat.decodeInterest(*this, input, inputLength);
   }
   
   void 
-  wireDecode(const std::vector<unsigned char>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
+  wireDecode(const std::vector<uint8_t>& input, WireFormat& wireFormat = *WireFormat::getDefaultWireFormat()) 
   {
     wireDecode(&input[0], input.size(), wireFormat);
   }
@@ -259,7 +259,7 @@
   setInterestLifetimeMilliseconds(double value) { interestLifetimeMilliseconds_ = value; }
 
   void 
-  setNonce(const std::vector<unsigned char>& value) { nonce_ = value; }
+  setNonce(const std::vector<uint8_t>& value) { nonce_ = value; }
   
 private:
   void 
diff --git a/ndn-cpp/key.cpp b/ndn-cpp/key.cpp
index b453471..ef57265 100644
--- a/ndn-cpp/key.cpp
+++ b/ndn-cpp/key.cpp
@@ -18,7 +18,7 @@
   
   keyLocatorStruct.keyDataLength = keyData_.size();
   if (keyData_.size() > 0)
-    keyLocatorStruct.keyData = (unsigned char *)keyData_.buf();
+    keyLocatorStruct.keyData = (uint8_t *)keyData_.buf();
   else
     keyLocatorStruct.keyData = 0;
 
diff --git a/ndn-cpp/key.hpp b/ndn-cpp/key.hpp
index b918d99..da9a11f 100644
--- a/ndn-cpp/key.hpp
+++ b/ndn-cpp/key.hpp
@@ -65,10 +65,10 @@
   setType(ndn_KeyLocatorType type) { type_ = type; }
   
   void 
-  setKeyData(const std::vector<unsigned char>& keyData) { keyData_ = keyData; }
+  setKeyData(const std::vector<uint8_t>& keyData) { keyData_ = keyData; }
   
   void 
-  setKeyData(const unsigned char *keyData, unsigned int keyDataLength) 
+  setKeyData(const uint8_t *keyData, unsigned int keyDataLength) 
   { 
     keyData_ = Blob(keyData, keyDataLength); 
   }
@@ -79,7 +79,7 @@
    * @param keyData A pointer to a vector with the byte array.  This takes another reference and does not copy the bytes.
    */
   void 
-  setKeyData(const ptr_lib::shared_ptr<std::vector<unsigned char> > &keyData) { keyData_ = keyData; }
+  setKeyData(const ptr_lib::shared_ptr<std::vector<uint8_t> > &keyData) { keyData_ = keyData; }
 
   void setKeyName(const Name &keyName) { keyName_ = keyName; }
   
diff --git a/ndn-cpp/name.cpp b/ndn-cpp/name.cpp
index 4e27db1..7534ba3 100644
--- a/ndn-cpp/name.cpp
+++ b/ndn-cpp/name.cpp
@@ -66,7 +66,7 @@
  * @return 
  */
 static int 
-fromHexChar(unsigned char c)
+fromHexChar(uint8_t c)
 {
   if (c >= '0' && c <= '9')
     return (int)c - (int)'0';
@@ -96,7 +96,7 @@
         // Invalid hex characters, so just keep the escaped string.
         result << str[i] << str[i + 1] << str[i + 2];
       else
-        result << (unsigned char)(16 * hi + lo);
+        result << (uint8_t)(16 * hi + lo);
       
       // Skip ahead past the escaped value.
       i += 2;
@@ -123,16 +123,16 @@
       return Blob();
     else
       // Remove 3 periods.
-      return Blob((const unsigned char *)&component[3], component.size() - 3); 
+      return Blob((const uint8_t *)&component[3], component.size() - 3); 
   }
   else
-    return Blob((const unsigned char *)&component[0], component.size()); 
+    return Blob((const uint8_t *)&component[0], component.size()); 
 }
 
 Blob 
 Name::Component::makeSegment(unsigned long segment)
 {
-  shared_ptr<vector<unsigned char> > value(new vector<unsigned char>());
+  shared_ptr<vector<uint8_t> > value(new vector<uint8_t>());
   
   // Add the leading zero.
   value->push_back(0);
@@ -298,7 +298,7 @@
 }
 
 void 
-Name::toEscapedString(const vector<unsigned char>& value, ostringstream& result)
+Name::toEscapedString(const vector<uint8_t>& value, ostringstream& result)
 {
   bool gotNonDot = false;
   for (unsigned i = 0; i < value.size(); ++i) {
@@ -318,7 +318,7 @@
     ios::fmtflags saveFlags = result.flags(ios::hex | ios::uppercase);
     
     for (unsigned int i = 0; i < value.size(); ++i) {
-      unsigned char x = value[i];
+      uint8_t x = value[i];
       // Check for 0-9, A-Z, a-z, (+), (-), (.), (_)
       if (x >= 0x30 && x <= 0x39 || x >= 0x41 && x <= 0x5a ||
         x >= 0x61 && x <= 0x7a || x == 0x2b || x == 0x2d || 
@@ -338,7 +338,7 @@
 }
 
 string
-Name::toEscapedString(const vector<unsigned char>& value)
+Name::toEscapedString(const vector<uint8_t>& value)
 {
   ostringstream result;
   toEscapedString(value, result);
diff --git a/ndn-cpp/name.hpp b/ndn-cpp/name.hpp
index 2fed5ba..7e9be6c 100644
--- a/ndn-cpp/name.hpp
+++ b/ndn-cpp/name.hpp
@@ -34,7 +34,7 @@
      * Create a new Name::Component, copying the given value.
      * @param value The value byte array.
      */
-    Component(const std::vector<unsigned char>& value) 
+    Component(const std::vector<uint8_t>& value) 
     : value_(value)
     {
     }
@@ -44,7 +44,7 @@
      * @param value Pointer to the value byte array.
      * @param valueLen Length of value.
      */
-    Component(const unsigned char *value, unsigned int valueLen) 
+    Component(const uint8_t *value, unsigned int valueLen) 
     : value_(value, valueLen)
     {
     }
@@ -68,7 +68,7 @@
     {
       componentStruct.valueLength = value_.size(); 
       if (value_.size() > 0)
-        componentStruct.value = (unsigned char*)value_.buf();
+        componentStruct.value = (uint8_t*)value_.buf();
       else
         componentStruct.value = 0;
     }
@@ -174,7 +174,7 @@
    * @return This name so that you can chain calls to append.
    */
   Name& 
-  append(const unsigned char *value, unsigned int valueLength) 
+  append(const uint8_t *value, unsigned int valueLength) 
   {
     components_.push_back(Component(value, valueLength));
     return *this;
@@ -185,7 +185,7 @@
    * @return This name so that you can chain calls to append.
    */
   Name& 
-  append(const std::vector<unsigned char>& value) 
+  append(const std::vector<uint8_t>& value) 
   {
     components_.push_back(value);
     return *this;
@@ -210,7 +210,7 @@
    * @deprecated Use append.
    */
   Name& 
-  appendComponent(const unsigned char *value, unsigned int valueLength) 
+  appendComponent(const uint8_t *value, unsigned int valueLength) 
   {
     return append(value, valueLength);
   }
@@ -219,7 +219,7 @@
    * @deprecated Use append.
    */
   Name& 
-  appendComponent(const std::vector<unsigned char>& value) 
+  appendComponent(const std::vector<uint8_t>& value) 
   {
     return append(value);
   }
@@ -237,7 +237,7 @@
    * @deprecated Use append.
    */
   Name& 
-  addComponent(const unsigned char *value, unsigned int valueLength) 
+  addComponent(const uint8_t *value, unsigned int valueLength) 
   {
     return append(value, valueLength);
   }
@@ -246,7 +246,7 @@
    * @deprecated Use append.
    */
   Name& 
-  addComponent(const std::vector<unsigned char>& value) 
+  addComponent(const std::vector<uint8_t>& value) 
   {
     return append(value);
   }
@@ -351,7 +351,7 @@
    * @param result the string stream to write to.
    */
   static void 
-  toEscapedString(const std::vector<unsigned char>& value, std::ostringstream& result);
+  toEscapedString(const std::vector<uint8_t>& value, std::ostringstream& result);
 
   /**
    * Convert the value by escaping characters according to the NDN URI Scheme.
@@ -360,7 +360,7 @@
    * @return The escaped string.
    */
   static std::string
-  toEscapedString(const std::vector<unsigned char>& value);
+  toEscapedString(const std::vector<uint8_t>& value);
 
 private:
   std::vector<Component> components_;
diff --git a/ndn-cpp/node.cpp b/ndn-cpp/node.cpp
index 76e12c9..6eb30fd 100644
--- a/ndn-cpp/node.cpp
+++ b/ndn-cpp/node.cpp
@@ -19,7 +19,7 @@
 
 namespace ndn {
 
-static unsigned char SELFREG_PUBLIC_KEY_DER[] = {
+static uint8_t SELFREG_PUBLIC_KEY_DER[] = {
 0x30, 0x81, 0x9F, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81,
 0x8D, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xE1, 0x7D, 0x30, 0xA7, 0xD8, 0x28, 0xAB, 0x1B, 0x84, 0x0B, 0x17,
 0x54, 0x2D, 0xCA, 0xF6, 0x20, 0x7A, 0xFD, 0x22, 0x1E, 0x08, 0x6B, 0x2A, 0x60, 0xD1, 0x6C, 0xB7, 0xF5, 0x44, 0x48, 0xBA,
@@ -31,7 +31,7 @@
 0x00, 01
 };
 
-static unsigned char SELFREG_PRIVATE_KEY_DER[] = {
+static uint8_t SELFREG_PRIVATE_KEY_DER[] = {
 0x30, 0x82, 0x02, 0x5d, 0x02, 0x01, 0x00, 0x02, 0x81, 0x81, 0x00, 0xe1, 0x7d, 0x30, 0xa7, 0xd8, 0x28, 0xab, 0x1b, 0x84,
 0x0b, 0x17, 0x54, 0x2d, 0xca, 0xf6, 0x20, 0x7a, 0xfd, 0x22, 0x1e, 0x08, 0x6b, 0x2a, 0x60, 0xd1, 0x6c, 0xb7, 0xf5, 0x44,
 0x48, 0xba, 0x9f, 0x3f, 0x08, 0xbc, 0xd0, 0x99, 0xdb, 0x21, 0xdd, 0x16, 0x2a, 0x77, 0x9e, 0x61, 0xaa, 0x89, 0xee, 0xe5,
@@ -79,7 +79,7 @@
   Sha256WithRsaSignature *signature = dynamic_cast<Sha256WithRsaSignature*>(data.getSignature());
   
   // Set the public key.
-  unsigned char publicKeyDigest[SHA256_DIGEST_LENGTH];
+  uint8_t publicKeyDigest[SHA256_DIGEST_LENGTH];
   ndn_digestSha256(SELFREG_PUBLIC_KEY_DER, sizeof(SELFREG_PUBLIC_KEY_DER), publicKeyDigest);
   signature->getPublisherPublicKeyDigest().setPublisherPublicKeyDigest(publicKeyDigest, sizeof(publicKeyDigest));
   signature->getKeyLocator().setType(ndn_KeyLocatorType_KEY);
@@ -87,12 +87,12 @@
 
   // Sign the fields.
   SignedBlob encoding = data.wireEncode(wireFormat);
-  unsigned char signedPortionDigest[SHA256_DIGEST_LENGTH];
+  uint8_t signedPortionDigest[SHA256_DIGEST_LENGTH];
   ndn_digestSha256(encoding.signedBuf(), encoding.signedSize(), signedPortionDigest);
-  unsigned char signatureBits[1000];
+  uint8_t signatureBits[1000];
   unsigned int signatureBitsLength;
   // Use a temporary pointer since d2i updates it.
-  const unsigned char *derPointer = SELFREG_PRIVATE_KEY_DER;
+  const uint8_t *derPointer = SELFREG_PRIVATE_KEY_DER;
   RSA *privateKey = d2i_RSAPrivateKey(NULL, &derPointer, sizeof(SELFREG_PRIVATE_KEY_DER));
   if (!privateKey)
     throw std::runtime_error("Error decoding private key in d2i_RSAPrivateKey");
@@ -189,8 +189,8 @@
   
   // Create an interest where the name has the encoded Data packet.
   Name interestName;
-  const unsigned char component0[] = "ndnx";
-  const unsigned char component2[] = "selfreg";
+  const uint8_t component0[] = "ndnx";
+  const uint8_t component2[] = "selfreg";
   interestName.addComponent(component0, sizeof(component0) - 1);
   interestName.addComponent(ndndId_);
   interestName.addComponent(component2, sizeof(component2) - 1);
@@ -224,7 +224,7 @@
 }
 
 void 
-Node::onReceivedElement(const unsigned char *element, unsigned int elementLength)
+Node::onReceivedElement(const uint8_t *element, unsigned int elementLength)
 {
   BinaryXmlDecoder decoder(element, elementLength);
   
diff --git a/ndn-cpp/node.hpp b/ndn-cpp/node.hpp
index 467a537..eba6eb5 100644
--- a/ndn-cpp/node.hpp
+++ b/ndn-cpp/node.hpp
@@ -90,7 +90,7 @@
   getConnectionInfo() { return connectionInfo_; }
 
   void 
-  onReceivedElement(const unsigned char *element, unsigned int elementLength);
+  onReceivedElement(const uint8_t *element, unsigned int elementLength);
   
   void 
   shutdown();
diff --git a/ndn-cpp/publisher-public-key-digest.hpp b/ndn-cpp/publisher-public-key-digest.hpp
index 9a31816..6abe8bd 100644
--- a/ndn-cpp/publisher-public-key-digest.hpp
+++ b/ndn-cpp/publisher-public-key-digest.hpp
@@ -32,7 +32,7 @@
   {
     publisherPublicKeyDigestStruct.publisherPublicKeyDigestLength = publisherPublicKeyDigest_.size();
     if (publisherPublicKeyDigest_.size() > 0)
-      publisherPublicKeyDigestStruct.publisherPublicKeyDigest = (unsigned char *)publisherPublicKeyDigest_.buf();
+      publisherPublicKeyDigestStruct.publisherPublicKeyDigest = (uint8_t *)publisherPublicKeyDigest_.buf();
     else
       publisherPublicKeyDigestStruct.publisherPublicKeyDigest = 0;
   }
@@ -52,13 +52,13 @@
   getPublisherPublicKeyDigest() const { return publisherPublicKeyDigest_; }
 
   void 
-  setPublisherPublicKeyDigest(const std::vector<unsigned char>& publisherPublicKeyDigest) 
+  setPublisherPublicKeyDigest(const std::vector<uint8_t>& publisherPublicKeyDigest) 
   { 
     publisherPublicKeyDigest_ = publisherPublicKeyDigest; 
   }
   
   void 
-  setPublisherPublicKeyDigest(const unsigned char *publisherPublicKeyDigest, unsigned int publisherPublicKeyDigestLength) 
+  setPublisherPublicKeyDigest(const uint8_t *publisherPublicKeyDigest, unsigned int publisherPublicKeyDigestLength) 
   { 
     publisherPublicKeyDigest_ = Blob(publisherPublicKeyDigest, publisherPublicKeyDigestLength); 
   }
@@ -69,13 +69,13 @@
    * @param signature A pointer to a vector with the byte array.  This takes another reference and does not copy the bytes.
    */
   void 
-  setPublisherPublicKeyDigest(const ptr_lib::shared_ptr<std::vector<unsigned char> > &publisherPublicKeyDigest) 
+  setPublisherPublicKeyDigest(const ptr_lib::shared_ptr<std::vector<uint8_t> > &publisherPublicKeyDigest) 
   { 
     publisherPublicKeyDigest_ = publisherPublicKeyDigest; 
   }
 
   void 
-  setPublisherPublicKeyDigest(const ptr_lib::shared_ptr<const std::vector<unsigned char> > &publisherPublicKeyDigest) 
+  setPublisherPublicKeyDigest(const ptr_lib::shared_ptr<const std::vector<uint8_t> > &publisherPublicKeyDigest) 
   { 
     publisherPublicKeyDigest_ = publisherPublicKeyDigest; 
   }
diff --git a/ndn-cpp/security/certificate/public-key.cpp b/ndn-cpp/security/certificate/public-key.cpp
index 1f64c07..3565ac3 100644
--- a/ndn-cpp/security/certificate/public-key.cpp
+++ b/ndn-cpp/security/certificate/public-key.cpp
@@ -32,7 +32,7 @@
 PublicKey::fromDer(const Blob& keyDer)
 {
   // Use a temporary pointer since d2i updates it.
-  const unsigned char *derPointer = keyDer.buf();
+  const uint8_t *derPointer = keyDer.buf();
   RSA *publicKey = d2i_RSA_PUBKEY(NULL, &derPointer, keyDer.size());
   if (!publicKey)
     throw UnrecognizedKeyFormatException("Error decoding public key DER");  
@@ -45,7 +45,7 @@
 PublicKey::getDigest(DigestAlgorithm digestAlgorithm) const
 {
   if (digestAlgorithm == DIGEST_ALGORITHM_SHA256) {
-    unsigned char digest[SHA256_DIGEST_LENGTH];
+    uint8_t digest[SHA256_DIGEST_LENGTH];
     ndn_digestSha256(keyDer_.buf(), keyDer_.size(), digest);
     
     return Blob(digest, sizeof(digest));
diff --git a/ndn-cpp/security/identity/memory-private-key-storage.cpp b/ndn-cpp/security/identity/memory-private-key-storage.cpp
index 56054af..0fef285 100644
--- a/ndn-cpp/security/identity/memory-private-key-storage.cpp
+++ b/ndn-cpp/security/identity/memory-private-key-storage.cpp
@@ -19,7 +19,7 @@
 }
 
 void MemoryPrivateKeyStorage::setKeyPairForKeyName
-  (const Name& keyName, unsigned char *publicKeyDer, size_t publicKeyDerLength, unsigned char *privateKeyDer, 
+  (const Name& keyName, uint8_t *publicKeyDer, size_t publicKeyDerLength, uint8_t *privateKeyDer, 
    size_t privateKeyDerLength)
 {
   publicKeyStore_[keyName.toUri()] = PublicKey::fromDer(Blob(publicKeyDer, publicKeyDerLength));
@@ -44,15 +44,15 @@
 }
 
 Blob 
-MemoryPrivateKeyStorage::sign(const unsigned char *data, unsigned int dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm)
+MemoryPrivateKeyStorage::sign(const uint8_t *data, unsigned int dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm)
 {
   if (digestAlgorithm != DIGEST_ALGORITHM_SHA256)
     return Blob();
 
-  unsigned char digest[SHA256_DIGEST_LENGTH];
+  uint8_t digest[SHA256_DIGEST_LENGTH];
   ndn_digestSha256(data, dataLength, digest);
   // TODO: use RSA_size to get the proper size of the signature buffer.
-  unsigned char signatureBits[1000];
+  uint8_t signatureBits[1000];
   unsigned int signatureBitsLength;
   
   // Find the private key and sign.
@@ -66,7 +66,7 @@
 }
 
 Blob 
-MemoryPrivateKeyStorage::decrypt(const Name& keyName, const unsigned char* data, unsigned int dataLength, bool isSymmetric)
+MemoryPrivateKeyStorage::decrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric)
 {
 #if 1
   throw std::runtime_error("MemoryPrivateKeyStorage::decrypt not implemented");
@@ -74,7 +74,7 @@
 }
 
 Blob
-MemoryPrivateKeyStorage::encrypt(const Name& keyName, const unsigned char* data, unsigned int dataLength, bool isSymmetric)
+MemoryPrivateKeyStorage::encrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric)
 {
 #if 1
   throw std::runtime_error("MemoryPrivateKeyStorage::encrypt not implemented");
@@ -101,10 +101,10 @@
     return false;
 }
 
-MemoryPrivateKeyStorage::RsaPrivateKey::RsaPrivateKey(unsigned char *keyDer, size_t keyDerLength)
+MemoryPrivateKeyStorage::RsaPrivateKey::RsaPrivateKey(uint8_t *keyDer, size_t keyDerLength)
 {
   // Use a temporary pointer since d2i updates it.
-  const unsigned char *derPointer = keyDer;
+  const uint8_t *derPointer = keyDer;
   privateKey_ = d2i_RSAPrivateKey(NULL, &derPointer, keyDerLength);
   if (!privateKey_)
     throw SecurityException("RsaPrivateKey constructor: Error decoding private key DER");
diff --git a/ndn-cpp/security/identity/memory-private-key-storage.hpp b/ndn-cpp/security/identity/memory-private-key-storage.hpp
index d97d2a8..b44f2ba 100644
--- a/ndn-cpp/security/identity/memory-private-key-storage.hpp
+++ b/ndn-cpp/security/identity/memory-private-key-storage.hpp
@@ -36,7 +36,7 @@
    * @param privateKeyDerLength The length of privateKeyDer.
    */
   void setKeyPairForKeyName
-    (const Name& keyName, unsigned char *publicKeyDer, size_t publicKeyDerLength, unsigned char *privateKeyDer, 
+    (const Name& keyName, uint8_t *publicKeyDer, size_t publicKeyDerLength, uint8_t *privateKeyDer, 
      size_t privateKeyDerLength);
   
   /**
@@ -65,7 +65,7 @@
    * @return The signature, or a null pointer if signing fails.
    */  
   virtual Blob 
-  sign(const unsigned char *data, unsigned int dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm);
+  sign(const uint8_t *data, unsigned int dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm);
     
   /**
    * Decrypt data.
@@ -76,7 +76,7 @@
    * @return The decrypted data.
    */
   virtual Blob 
-  decrypt(const Name& keyName, const unsigned char* data, unsigned int dataLength, bool isSymmetric);
+  decrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric);
 
   /**
    * Encrypt data.
@@ -87,7 +87,7 @@
    * @return The encrypted data.
    */
   virtual Blob
-  encrypt(const Name& keyName, const unsigned char* data, unsigned int dataLength, bool isSymmetric);
+  encrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric);
 
   /**
    * @brief Generate a symmetric key.
@@ -113,7 +113,7 @@
    */
   class RsaPrivateKey {
   public:
-    RsaPrivateKey(unsigned char *keyDer, size_t keyDerLength);
+    RsaPrivateKey(uint8_t *keyDer, size_t keyDerLength);
     
     ~RsaPrivateKey();
     
diff --git a/ndn-cpp/security/identity/private-key-storage.hpp b/ndn-cpp/security/identity/private-key-storage.hpp
index 3b71d37..0e24eec 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 unsigned char *data, unsigned int dataLength, const Name& keyName, DigestAlgorithm digestAlgorithm = DIGEST_ALGORITHM_SHA256) = 0;
+  sign(const uint8_t *data, unsigned int 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 unsigned char* data, unsigned int dataLength, bool isSymmetric = false) = 0;
+  decrypt(const Name& keyName, const uint8_t* data, unsigned int 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 unsigned char* data, unsigned int dataLength, bool isSymmetric = false) = 0;
+  encrypt(const Name& keyName, const uint8_t* data, unsigned int dataLength, bool isSymmetric = false) = 0;
 
   Blob
   encrypt(const Name& keyName, const Blob& data, bool isSymmetric = false)
diff --git a/ndn-cpp/security/key-chain.cpp b/ndn-cpp/security/key-chain.cpp
index 85df172..fdfc998 100644
--- a/ndn-cpp/security/key-chain.cpp
+++ b/ndn-cpp/security/key-chain.cpp
@@ -18,7 +18,7 @@
 namespace ndn {
 
 #if 1
-static unsigned char DEFAULT_PUBLIC_KEY_DER[] = {
+static uint8_t DEFAULT_PUBLIC_KEY_DER[] = {
 0x30, 0x81, 0x9F, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x81,
 0x8D, 0x00, 0x30, 0x81, 0x89, 0x02, 0x81, 0x81, 0x00, 0xE1, 0x7D, 0x30, 0xA7, 0xD8, 0x28, 0xAB, 0x1B, 0x84, 0x0B, 0x17,
 0x54, 0x2D, 0xCA, 0xF6, 0x20, 0x7A, 0xFD, 0x22, 0x1E, 0x08, 0x6B, 0x2A, 0x60, 0xD1, 0x6C, 0xB7, 0xF5, 0x44, 0x48, 0xBA,
@@ -78,17 +78,17 @@
   if (!data.getWireEncoding())
     // Don't expect this to happen
     throw SecurityException("The Data wireEncoding is null.");
-  unsigned char signedPortionDigest[SHA256_DIGEST_LENGTH];
+  uint8_t signedPortionDigest[SHA256_DIGEST_LENGTH];
   ndn_digestSha256(data.getWireEncoding().signedBuf(), data.getWireEncoding().signedSize(), signedPortionDigest);
   
   // Verify the signedPortionDigest.
   // Use a temporary pointer since d2i updates it.
-  const unsigned char *derPointer = DEFAULT_PUBLIC_KEY_DER;
+  const uint8_t *derPointer = DEFAULT_PUBLIC_KEY_DER;
   RSA *publicKey = d2i_RSA_PUBKEY(NULL, &derPointer, sizeof(DEFAULT_PUBLIC_KEY_DER));
   if (!publicKey)
     throw UnrecognizedKeyFormatException("Error decoding public key in d2i_RSAPublicKey");
   int success = RSA_verify
-    (NID_sha256, signedPortionDigest, sizeof(signedPortionDigest), (unsigned char *)signature->getSignature().buf(), 
+    (NID_sha256, signedPortionDigest, sizeof(signedPortionDigest), (uint8_t *)signature->getSignature().buf(), 
      signature->getSignature().size(), publicKey);
   // Free the public key before checking for success.
   RSA_free(publicKey);
diff --git a/ndn-cpp/sha256-with-rsa-signature.cpp b/ndn-cpp/sha256-with-rsa-signature.cpp
index c2c933f..5862faa 100644
--- a/ndn-cpp/sha256-with-rsa-signature.cpp
+++ b/ndn-cpp/sha256-with-rsa-signature.cpp
@@ -22,19 +22,19 @@
 {
   signatureStruct.digestAlgorithmLength = digestAlgorithm_.size();
   if (digestAlgorithm_.size() > 0)
-    signatureStruct.digestAlgorithm = (unsigned char *)digestAlgorithm_.buf();
+    signatureStruct.digestAlgorithm = (uint8_t *)digestAlgorithm_.buf();
   else
     signatureStruct.digestAlgorithm = 0;
 
   signatureStruct.witnessLength = witness_.size();
   if (witness_.size() > 0)
-    signatureStruct.witness = (unsigned char *)witness_.buf();
+    signatureStruct.witness = (uint8_t *)witness_.buf();
   else
     signatureStruct.witness = 0;
 
   signatureStruct.signatureLength = signature_.size();
   if (signature_.size() > 0)
-    signatureStruct.signature = (unsigned char *)signature_.buf();
+    signatureStruct.signature = (uint8_t *)signature_.buf();
   else
     signatureStruct.signature = 0;
   
diff --git a/ndn-cpp/sha256-with-rsa-signature.hpp b/ndn-cpp/sha256-with-rsa-signature.hpp
index 5bb3951..93bae74 100644
--- a/ndn-cpp/sha256-with-rsa-signature.hpp
+++ b/ndn-cpp/sha256-with-rsa-signature.hpp
@@ -62,28 +62,28 @@
   getKeyLocator() { return keyLocator_; }
 
   void 
-  setDigestAlgorithm(const std::vector<unsigned char>& digestAlgorithm) { digestAlgorithm_ = digestAlgorithm; }
+  setDigestAlgorithm(const std::vector<uint8_t>& digestAlgorithm) { digestAlgorithm_ = digestAlgorithm; }
   
   void 
-  setDigestAlgorithm(const unsigned char *digestAlgorithm, unsigned int digestAlgorithmLength) 
+  setDigestAlgorithm(const uint8_t *digestAlgorithm, unsigned int digestAlgorithmLength) 
   { 
     digestAlgorithm_ = Blob(digestAlgorithm, digestAlgorithmLength); 
   }
 
   void 
-  setWitness(const std::vector<unsigned char>& witness) { witness_ = witness; }
+  setWitness(const std::vector<uint8_t>& witness) { witness_ = witness; }
   
   void 
-  setWitness(const unsigned char *witness, unsigned int witnessLength) 
+  setWitness(const uint8_t *witness, unsigned int witnessLength) 
   { 
     witness_ = Blob(witness, witnessLength); 
   }
 
   void 
-  setSignature(const std::vector<unsigned char>& signature) { signature_ = signature; }
+  setSignature(const std::vector<uint8_t>& signature) { signature_ = signature; }
   
   void 
-  setSignature(const unsigned char *signature, unsigned int signatureLength) 
+  setSignature(const uint8_t *signature, unsigned int signatureLength) 
   { 
     signature_ = Blob(signature, signatureLength); 
   }
@@ -94,10 +94,10 @@
    * @param signature A pointer to a vector with the byte array.  This takes another reference and does not copy the bytes.
    */
   void 
-  setSignature(const ptr_lib::shared_ptr<std::vector<unsigned char> > &signature) { signature_ = signature; }
+  setSignature(const ptr_lib::shared_ptr<std::vector<uint8_t> > &signature) { signature_ = signature; }
 
   void 
-  setSignature(const ptr_lib::shared_ptr<const std::vector<unsigned char> > &signature) { signature_ = signature; }
+  setSignature(const ptr_lib::shared_ptr<const std::vector<uint8_t> > &signature) { signature_ = signature; }
 
   void 
   setPublisherPublicKeyDigest(const PublisherPublicKeyDigest& publisherPublicKeyDigest) { publisherPublicKeyDigest_ = publisherPublicKeyDigest; }
diff --git a/ndn-cpp/transport/tcp-transport.cpp b/ndn-cpp/transport/tcp-transport.cpp
index e454e4a..553c5c7 100644
--- a/ndn-cpp/transport/tcp-transport.cpp
+++ b/ndn-cpp/transport/tcp-transport.cpp
@@ -30,17 +30,17 @@
   const unsigned int initialLength = 1000;
   // Automatically cast elementReader_ to (struct ndn_ElementListener *)
   ndn_BinaryXmlElementReader_initialize
-    (&elementReader_, &elementListener, (unsigned char *)malloc(initialLength), initialLength, ndn_realloc);
+    (&elementReader_, &elementListener, (uint8_t *)malloc(initialLength), initialLength, ndn_realloc);
   
   isConnected_ = true;
   elementListener_ = &elementListener;
 }
 
 void 
-TcpTransport::send(const unsigned char *data, unsigned int dataLength)
+TcpTransport::send(const uint8_t *data, unsigned int dataLength)
 {
   ndn_Error error;
-  if ((error = ndn_TcpTransport_send(&transport_, (unsigned char *)data, dataLength)))
+  if ((error = ndn_TcpTransport_send(&transport_, (uint8_t *)data, dataLength)))
     throw std::runtime_error(ndn_getErrorString(error));  
 }
 
@@ -54,7 +54,7 @@
   if (!receiveIsReady)
     return;
 
-  unsigned char buffer[8000];
+  uint8_t buffer[8000];
   unsigned int 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 1f8a573..d999df8 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 unsigned char *data, unsigned int dataLength);
+  virtual void send(const uint8_t *data, unsigned int 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 ae532db..4b8aca1 100644
--- a/ndn-cpp/transport/transport.cpp
+++ b/ndn-cpp/transport/transport.cpp
@@ -22,7 +22,7 @@
 }
   
 void 
-Transport::send(const unsigned char *data, unsigned int dataLength)
+Transport::send(const uint8_t *data, unsigned int dataLength)
 {
   throw logic_error("unimplemented");
 }
diff --git a/ndn-cpp/transport/transport.hpp b/ndn-cpp/transport/transport.hpp
index 2f71096..ed3e240 100644
--- a/ndn-cpp/transport/transport.hpp
+++ b/ndn-cpp/transport/transport.hpp
@@ -37,10 +37,10 @@
    * @param dataLength The number of bytes in data.
    */
   virtual void 
-  send(const unsigned char *data, unsigned int dataLength);
+  send(const uint8_t *data, unsigned int dataLength);
   
   void 
-  send(const std::vector<unsigned char>& data)
+  send(const std::vector<uint8_t>& data)
   {
     send(&data[0], data.size());
   }
diff --git a/ndn-cpp/transport/udp-transport.cpp b/ndn-cpp/transport/udp-transport.cpp
index d5e48cb..0b2f397 100644
--- a/ndn-cpp/transport/udp-transport.cpp
+++ b/ndn-cpp/transport/udp-transport.cpp
@@ -30,17 +30,17 @@
   const unsigned int initialLength = 1000;
   // Automatically cast elementReader_ to (struct ndn_ElementListener *)
   ndn_BinaryXmlElementReader_initialize
-    (&elementReader_, &elementListener, (unsigned char *)malloc(initialLength), initialLength, ndn_realloc);
+    (&elementReader_, &elementListener, (uint8_t *)malloc(initialLength), initialLength, ndn_realloc);
   
   isConnected_ = true;
   elementListener_ = &elementListener;
 }
 
 void 
-UdpTransport::send(const unsigned char *data, unsigned int dataLength)
+UdpTransport::send(const uint8_t *data, unsigned int dataLength)
 {
   ndn_Error error;
-  if ((error = ndn_UdpTransport_send(&transport_, (unsigned char *)data, dataLength)))
+  if ((error = ndn_UdpTransport_send(&transport_, (uint8_t *)data, dataLength)))
     throw std::runtime_error(ndn_getErrorString(error));  
 }
 
@@ -54,7 +54,7 @@
   if (!receiveIsReady)
     return;
 
-  unsigned char buffer[8000];
+  uint8_t buffer[8000];
   unsigned int 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 3ea1703..b2374df 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 unsigned char *data, unsigned int dataLength);
+  send(const uint8_t *data, unsigned int 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 0572301..d71808d 100644
--- a/ndn-cpp/util/blob.hpp
+++ b/ndn-cpp/util/blob.hpp
@@ -12,16 +12,16 @@
 namespace ndn {
 
 /**
- * A Blob holds a pointer to an immutable byte array implemented as const std::vector<unsigned char>.  
+ * A Blob holds a pointer to an immutable byte array implemented as const std::vector<uint8_t>.  
  * This is like a JavaScript string which is a pointer to an immutable string.  
  * It is OK to pass a pointer to the string because the new owner can't change the bytes
  * of the string.  However, like a JavaScript string, it is possible to change the pointer, and so this does allow
  * the copy constructor and assignment to change the pointer.  Also remember that the pointer can be null.
- * (Note that we could have made Blob derive directly from vector<unsigned char> and then explicitly use
+ * (Note that we could have made Blob derive directly from vector<uint8_t> and then explicitly use
  * a pointer to it like shared_ptr<Blob>, but this does not enforce immutability because we can't declare
- * Blob as derived from const vector<unsigned char>.)
+ * Blob as derived from const vector<uint8_t>.)
  */
-class Blob : public ptr_lib::shared_ptr<const std::vector<unsigned char> > {
+class Blob : public ptr_lib::shared_ptr<const std::vector<uint8_t> > {
 public:
   /**
    * Create a new Blob with a null pointer.
@@ -35,19 +35,19 @@
    * @param value A pointer to the byte array which is copied.
    * @param valueLength The length of value.
    */
-  Blob(const unsigned char* value, unsigned int valueLength)
-  : ptr_lib::shared_ptr<const std::vector<unsigned char> >(new std::vector<unsigned char>(value, value + valueLength))
+  Blob(const uint8_t* value, unsigned int valueLength)
+  : ptr_lib::shared_ptr<const std::vector<uint8_t> >(new std::vector<uint8_t>(value, value + valueLength))
   {
   }
   
   /**
    * Create a new Blob with an immutable copy of the array in the given vector.
    * If you want to transfer the array without copying, the the vector has to start as a 
-   * ptr_lib::shared_ptr<std::vector<unsigned char> > and you can use the Blob constructor with this type.
+   * ptr_lib::shared_ptr<std::vector<uint8_t> > and you can use the Blob constructor with this type.
    * @param value A reference to a vector which is copied.
    */
-  Blob(const std::vector<unsigned char> &value)
-  : ptr_lib::shared_ptr<const std::vector<unsigned char> >(new std::vector<unsigned char>(value))
+  Blob(const std::vector<uint8_t> &value)
+  : ptr_lib::shared_ptr<const std::vector<uint8_t> >(new std::vector<uint8_t>(value))
   {
   }
   
@@ -56,12 +56,12 @@
    * if you keep a pointer to the array then you must treat the array as immutable and promise not to change it.
    * @param value A pointer to a vector with the byte array.  This takes another reference and does not copy the bytes.
    */
-  Blob(const ptr_lib::shared_ptr<std::vector<unsigned char> > &value)
-  : ptr_lib::shared_ptr<const std::vector<unsigned char> >(value)
+  Blob(const ptr_lib::shared_ptr<std::vector<uint8_t> > &value)
+  : ptr_lib::shared_ptr<const std::vector<uint8_t> >(value)
   {
   }
-  Blob(const ptr_lib::shared_ptr<const std::vector<unsigned char> > &value)
-  : ptr_lib::shared_ptr<const std::vector<unsigned char> >(value)
+  Blob(const ptr_lib::shared_ptr<const std::vector<uint8_t> > &value)
+  : ptr_lib::shared_ptr<const std::vector<uint8_t> >(value)
   {
   }
   
@@ -80,7 +80,7 @@
   /**
    * Return a const pointer to the first byte of the immutable byte array, or 0 if the pointer is null.
    */
-  const unsigned char* 
+  const uint8_t* 
   buf() const
   {
     if (*this)
diff --git a/ndn-cpp/util/dynamic-uchar-vector.cpp b/ndn-cpp/util/dynamic-uchar-vector.cpp
deleted file mode 100644
index 4b17e63..0000000
--- a/ndn-cpp/util/dynamic-uchar-vector.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#include "dynamic-uchar-vector.hpp"
-
-using namespace std;
-
-namespace ndn {
-
-DynamicUCharVector::DynamicUCharVector(unsigned int initialLength)
-: vector_(new vector<unsigned char>(initialLength))
-{
-  ndn_DynamicUCharArray_initialize(this, &vector_->front(), initialLength, DynamicUCharVector::realloc);
-}
-
-unsigned char*
-DynamicUCharVector::realloc(struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length)
-{
-  // Because this method is private, assume there is not a problem with upcasting.
-  DynamicUCharVector *thisObject = (DynamicUCharVector *)self;
-  
-  if (array != &thisObject->vector_->front())
-    // We don't expect this to ever happen. The caller didn't pass the array from this object.
-    return 0;
-  
-  thisObject->vector_->resize(length);
-  return &thisObject->vector_->front();
-}
-
-}
diff --git a/ndn-cpp/util/dynamic-uchar-vector.hpp b/ndn-cpp/util/dynamic-uchar-vector.hpp
deleted file mode 100644
index 68950a9..0000000
--- a/ndn-cpp/util/dynamic-uchar-vector.hpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#ifndef NDN_DYNAMIC_UCHAR_VECTOR_HPP
-#define NDN_DYNAMIC_UCHAR_VECTOR_HPP
-
-#include <vector>
-#include "../common.hpp"
-#include "../c/util/dynamic-uchar-array.h"
-
-namespace ndn {
-
-/**
- * A DynamicUCharVector extends ndn_DynamicUCharArray to hold a shared_ptr<vector<unsigned char> > for use with
- * C functions which need an ndn_DynamicUCharArray.
- */
-class DynamicUCharVector : public ndn_DynamicUCharArray {
-public:
-  /**
-   * Create a new DynamicUCharVector with an initial length.
-   * @param initialLength The initial size of the allocated vector.
-   */
-  DynamicUCharVector(unsigned int initialLength);
-  
-  /**
-   * Get the shared_ptr to the allocated vector.
-   * @return The shared_ptr to the allocated vector. 
-   */
-  const ptr_lib::shared_ptr<std::vector<unsigned char> >& 
-  get() { return vector_; }
-  
-private:
-  /**
-   * Implement the static realloc function using vector resize.
-   * @param self A pointer to this object.
-   * @param array Should be the front of the vector.
-   * @param length The new length for the vector.
-   * @return The front of the allocated vector.
-   */
-  static unsigned char*
-  realloc(struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length);
-  
-  ptr_lib::shared_ptr<std::vector<unsigned char> > vector_;
-};
-
-}
-
-#endif
diff --git a/ndn-cpp/util/dynamic-uint8-vector.cpp b/ndn-cpp/util/dynamic-uint8-vector.cpp
new file mode 100644
index 0000000..240baa6
--- /dev/null
+++ b/ndn-cpp/util/dynamic-uint8-vector.cpp
@@ -0,0 +1,33 @@
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * @author: Jeff Thompson <jefft0@remap.ucla.edu>
+ * See COPYING for copyright and distribution information.
+ */
+
+#include "dynamic-uint8-vector.hpp"
+
+using namespace std;
+
+namespace ndn {
+
+DynamicUInt8Vector::DynamicUInt8Vector(unsigned int 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)
+{
+  // Because this method is private, assume there is not a problem with upcasting.
+  DynamicUInt8Vector *thisObject = (DynamicUInt8Vector *)self;
+  
+  if (array != &thisObject->vector_->front())
+    // We don't expect this to ever happen. The caller didn't pass the array from this object.
+    return 0;
+  
+  thisObject->vector_->resize(length);
+  return &thisObject->vector_->front();
+}
+
+}
diff --git a/ndn-cpp/util/dynamic-uint8-vector.hpp b/ndn-cpp/util/dynamic-uint8-vector.hpp
new file mode 100644
index 0000000..2c6247e
--- /dev/null
+++ b/ndn-cpp/util/dynamic-uint8-vector.hpp
@@ -0,0 +1,51 @@
+/**
+ * Copyright (C) 2013 Regents of the University of California.
+ * @author: Jeff Thompson <jefft0@remap.ucla.edu>
+ * See COPYING for copyright and distribution information.
+ */
+
+#ifndef NDN_DYNAMIC_UCHAR_VECTOR_HPP
+#define NDN_DYNAMIC_UCHAR_VECTOR_HPP
+
+#include <vector>
+#include "../common.hpp"
+#include "../c/util/dynamic-uint8-array.h"
+
+namespace ndn {
+
+/**
+ * A DynamicUInt8Vector extends ndn_DynamicUInt8Array to hold a shared_ptr<vector<uint8_t> > for use with
+ * C functions which need an ndn_DynamicUInt8Array.
+ */
+class DynamicUInt8Vector : public ndn_DynamicUInt8Array {
+public:
+  /**
+   * Create a new DynamicUInt8Vector with an initial length.
+   * @param initialLength The initial size of the allocated vector.
+   */
+  DynamicUInt8Vector(unsigned int initialLength);
+  
+  /**
+   * Get the shared_ptr to the allocated vector.
+   * @return The shared_ptr to the allocated vector. 
+   */
+  const ptr_lib::shared_ptr<std::vector<uint8_t> >& 
+  get() { return vector_; }
+  
+private:
+  /**
+   * Implement the static realloc function using vector resize.
+   * @param self A pointer to this object.
+   * @param array Should be the front of the vector.
+   * @param length The new length for the vector.
+   * @return The front of the allocated vector.
+   */
+  static uint8_t*
+  realloc(struct ndn_DynamicUInt8Array *self, uint8_t *array, unsigned int length);
+  
+  ptr_lib::shared_ptr<std::vector<uint8_t> > vector_;
+};
+
+}
+
+#endif
diff --git a/ndn-cpp/util/logging.hpp b/ndn-cpp/util/logging.hpp
index 84ad405..e6a402f 100644
--- a/ndn-cpp/util/logging.hpp
+++ b/ndn-cpp/util/logging.hpp
@@ -9,7 +9,7 @@
 #ifndef NDN_LOGGING_HPP
 #define	NDN_LOGGING_HPP
 
-#include "../../config.h"
+#include "../common.hpp"
 
 #ifdef HAVE_LOG4CXX
 
diff --git a/ndn-cpp/util/signed-blob.hpp b/ndn-cpp/util/signed-blob.hpp
index 0b6cdda..62e6ee2 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 unsigned char* value, unsigned int valueLength, unsigned int signedPortionBeginOffset, unsigned int signedPortionEndOffset)
+    (const uint8_t* value, unsigned int valueLength, unsigned int signedPortionBeginOffset, unsigned int signedPortionEndOffset)
   : Blob(value, valueLength), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
   {
   }
@@ -42,13 +42,13 @@
   /**
    * Create a new SignedBlob with an immutable copy of the array in the given vector.
    * If you want to transfer the array without copying, the the vector has to start as a 
-   * ptr_lib::shared_ptr<std::vector<unsigned char> > and you can use the SignedBlob constructor with this type.
+   * ptr_lib::shared_ptr<std::vector<uint8_t> > and you can use the SignedBlob constructor with this type.
    * @param value A reference to a vector which is copied.
    * @param signedPortionBeginOffset The offset in the encoding of the beginning of the signed portion.
    * @param signedPortionEndOffset The offset in the encoding of the end of the signed portion.
    */
   SignedBlob
-    (const std::vector<unsigned char> &value, unsigned int signedPortionBeginOffset, unsigned int signedPortionEndOffset)
+    (const std::vector<uint8_t> &value, unsigned int signedPortionBeginOffset, unsigned int signedPortionEndOffset)
   : Blob(value), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
   {
   }
@@ -61,13 +61,13 @@
    * @param signedPortionEndOffset The offset in the array of the end of the signed portion.
    */
   SignedBlob
-    (const ptr_lib::shared_ptr<std::vector<unsigned char> > &value, 
+    (const ptr_lib::shared_ptr<std::vector<uint8_t> > &value, 
      unsigned int signedPortionBeginOffset, unsigned int signedPortionEndOffset)
   : Blob(value), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
   {
   }
   SignedBlob
-    (const ptr_lib::shared_ptr<const std::vector<unsigned char> > &value, 
+    (const ptr_lib::shared_ptr<const std::vector<uint8_t> > &value, 
      unsigned int signedPortionBeginOffset, unsigned int signedPortionEndOffset)
   : Blob(value), signedPortionBeginOffset_(signedPortionBeginOffset), signedPortionEndOffset_(signedPortionEndOffset)
   {
@@ -89,7 +89,7 @@
    * Return a const pointer to the first byte of the signed portion of the immutable byte array, or 0 if the 
    * pointer to the array is null.
    */
-  const unsigned char*
+  const uint8_t*
   signedBuf() const
   {
     if (*this)
