From 9e0aad9fd60635e240f7742fa1497eced6f1cd0b Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sat, 15 May 2004 11:29:55 +0000 Subject: size_t-fication of message digest APIs. We should size_t-fy more APIs... --- crypto/md2/md2.h | 4 ++-- crypto/md2/md2_dgst.c | 6 +++--- crypto/md2/md2_one.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'crypto/md2') diff --git a/crypto/md2/md2.h b/crypto/md2/md2.h index 6fcb9b1bdc..45bf4cc29c 100644 --- a/crypto/md2/md2.h +++ b/crypto/md2/md2.h @@ -81,9 +81,9 @@ typedef struct MD2state_st const char *MD2_options(void); int MD2_Init(MD2_CTX *c); -int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len); +int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); int MD2_Final(unsigned char *md, MD2_CTX *c); -unsigned char *MD2(const unsigned char *d, unsigned long n,unsigned char *md); +unsigned char *MD2(const unsigned char *d, size_t n,unsigned char *md); #ifdef __cplusplus } #endif diff --git a/crypto/md2/md2_dgst.c b/crypto/md2/md2_dgst.c index ecb64f0ec4..15e77d60be 100644 --- a/crypto/md2/md2_dgst.c +++ b/crypto/md2/md2_dgst.c @@ -125,7 +125,7 @@ int MD2_Init(MD2_CTX *c) return 1; } -int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len) +int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len) { register UCHAR *p; @@ -145,7 +145,7 @@ int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len) } else { - memcpy(&(p[c->num]),data,(int)len); + memcpy(&(p[c->num]),data,len); /* data+=len; */ c->num+=(int)len; return 1; @@ -159,7 +159,7 @@ int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len) data+=MD2_BLOCK; len-=MD2_BLOCK; } - memcpy(p,data,(int)len); + memcpy(p,data,len); c->num=(int)len; return 1; } diff --git a/crypto/md2/md2_one.c b/crypto/md2/md2_one.c index 835160ef56..dab35071ac 100644 --- a/crypto/md2/md2_one.c +++ b/crypto/md2/md2_one.c @@ -63,7 +63,7 @@ /* This is a separate file so that #defines in cryptlib.h can * map my MD functions to different names */ -unsigned char *MD2(const unsigned char *d, unsigned long n, unsigned char *md) +unsigned char *MD2(const unsigned char *d, size_t n, unsigned char *md) { MD2_CTX c; static unsigned char m[MD2_DIGEST_LENGTH]; -- cgit v1.2.3