- Modified XTEA to use uint32_t instead of unsigned long

diff --git a/include/polarssl/xtea.h b/include/polarssl/xtea.h
index 770ecc2..45f7547 100644
--- a/include/polarssl/xtea.h
+++ b/include/polarssl/xtea.h
@@ -20,6 +20,8 @@
 #ifndef POLARSSL_XTEA_H
 #define POLARSSL_XTEA_H
 
+#include <inttypes.h>
+
 #define XTEA_ENCRYPT     1
 #define XTEA_DECRYPT     0
 
@@ -29,7 +31,7 @@
  */
 typedef struct
 {
-    unsigned long k[4];       /*!< key */
+    uint32_t k[4];       /*!< key */
 }
 xtea_context;
 
diff --git a/library/xtea.c b/library/xtea.c
index 9fc4acd..c610a90 100644
--- a/library/xtea.c
+++ b/library/xtea.c
@@ -33,9 +33,9 @@
 #define GET_ULONG_BE(n,b,i)                             \
 {                                                       \
     (n) = ( (unsigned long) (b)[(i)    ] << 24 )        \
-	| ( (unsigned long) (b)[(i) + 1] << 16 )        \
-	| ( (unsigned long) (b)[(i) + 2] <<  8 )        \
-	| ( (unsigned long) (b)[(i) + 3]       );       \
+	    | ( (unsigned long) (b)[(i) + 1] << 16 )        \
+	    | ( (unsigned long) (b)[(i) + 2] <<  8 )        \
+	    | ( (unsigned long) (b)[(i) + 3]       );       \
 }
 #endif
 
@@ -67,9 +67,10 @@
 /*
  * XTEA encrypt function
  */
-void xtea_crypt_ecb( xtea_context *ctx, int mode, unsigned char input[8], unsigned char output[8])
+void xtea_crypt_ecb( xtea_context *ctx, int mode, unsigned char input[8],
+                     unsigned char output[8])
 {
-    unsigned long *k, v0, v1, i;
+    uint32_t *k, v0, v1, i;
 
     k = ctx->k;
     
@@ -78,7 +79,7 @@
 
     if( mode == XTEA_ENCRYPT )
     {
-	    unsigned long sum = 0, delta = 0x9E3779B9;
+	    uint32_t sum = 0, delta = 0x9E3779B9;
 
 	    for( i = 0; i < 32; i++ )
 	    {
@@ -89,7 +90,7 @@
     }
     else /* XTEA_DECRYPT */
     {
-	    unsigned long delta = 0x9E3779B9, sum = delta * 32;
+	    uint32_t delta = 0x9E3779B9, sum = delta * 32;
 
 	    for( i = 0; i < 32; i++ )
 	    {
@@ -114,12 +115,18 @@
 
 static const unsigned char xtea_test_key[6][16] =
 {
-   { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
-   { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
-   { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f },
-   { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
-   { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
-   { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
+   { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+     0x0c, 0x0d, 0x0e, 0x0f },
+   { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+     0x0c, 0x0d, 0x0e, 0x0f },
+   { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
+     0x0c, 0x0d, 0x0e, 0x0f },
+   { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+     0x00, 0x00, 0x00, 0x00 },
+   { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+     0x00, 0x00, 0x00, 0x00 },
+   { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+     0x00, 0x00, 0x00, 0x00 }
 };
 
 static const unsigned char xtea_test_pt[6][8] =