- Major type rewrite of int to size_t for most variables and arguments used for buffer lengths and loops
diff --git a/library/dhm.c b/library/dhm.c
index 4b78722..1a8211e 100644
--- a/library/dhm.c
+++ b/library/dhm.c
@@ -34,8 +34,6 @@
 
 #include "polarssl/dhm.h"
 
-#include <string.h>
-
 /*
  * helper to validate the mpi size and import it
  */
@@ -128,10 +126,11 @@
  * Setup and write the ServerKeyExchange parameters
  */
 int dhm_make_params( dhm_context *ctx, int x_size,
-                     unsigned char *output, int *olen,
+                     unsigned char *output, size_t *olen,
                      int (*f_rng)(void *), void *p_rng )
 {
-    int ret, n, n1, n2, n3;
+    int ret, n;
+    size_t n1, n2, n3;
     unsigned char *p;
 
     /*
@@ -186,7 +185,7 @@
  * Import the peer's public value G^Y
  */
 int dhm_read_public( dhm_context *ctx,
-                     const unsigned char *input, int ilen )
+                     const unsigned char *input, size_t ilen )
 {
     int ret;
 
@@ -203,7 +202,7 @@
  * Create own private value X and export G^X
  */
 int dhm_make_public( dhm_context *ctx, int x_size,
-                     unsigned char *output, int olen,
+                     unsigned char *output, size_t olen,
                      int (*f_rng)(void *), void *p_rng )
 {
     int ret, n;
@@ -241,7 +240,7 @@
  * Derive and export the shared secret (G^Y)^X mod P
  */
 int dhm_calc_secret( dhm_context *ctx,
-                     unsigned char *output, int *olen )
+                     unsigned char *output, size_t *olen )
 {
     int ret;