aboutsummaryrefslogtreecommitdiff
path: root/library/dhm.c
diff options
context:
space:
mode:
authorPaul Bakker <p.j.bakker@polarssl.org>2011-04-24 08:57:21 +0000
committerPaul Bakker <p.j.bakker@polarssl.org>2011-04-24 08:57:21 +0000
commit23986e5d5d501ae93bed161752708ba18fb9e016 (patch)
treec6e3d8251151695fcd38167c21af5e5290f915b3 /library/dhm.c
parent1be81a4e5feca5b46aa886b55a0096f2dfb33c1b (diff)
downloadmbedtls-23986e5d5d501ae93bed161752708ba18fb9e016.zip
mbedtls-23986e5d5d501ae93bed161752708ba18fb9e016.tar.gz
mbedtls-23986e5d5d501ae93bed161752708ba18fb9e016.tar.bz2
- Major type rewrite of int to size_t for most variables and arguments used for buffer lengths and loops
Diffstat (limited to 'library/dhm.c')
-rw-r--r--library/dhm.c13
1 files changed, 6 insertions, 7 deletions
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 @@ int dhm_read_params( dhm_context *ctx,
* 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 @@ cleanup:
* 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 @@ int dhm_read_public( dhm_context *ctx,
* 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 @@ cleanup:
* 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;