summaryrefslogtreecommitdiff
path: root/crypto/mdc2
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2004-05-15 11:29:55 +0000
committerAndy Polyakov <appro@openssl.org>2004-05-15 11:29:55 +0000
commit9e0aad9fd60635e240f7742fa1497eced6f1cd0b (patch)
tree3bcdb1f59b421e626a2c94ea743ccc4d18628c1c /crypto/mdc2
parent1c7a0e2856bce20267174375fd66007fa172354d (diff)
downloadopenssl-new-9e0aad9fd60635e240f7742fa1497eced6f1cd0b.tar.gz
size_t-fication of message digest APIs. We should size_t-fy more APIs...
Diffstat (limited to 'crypto/mdc2')
-rw-r--r--crypto/mdc2/mdc2.h4
-rw-r--r--crypto/mdc2/mdc2_one.c2
-rw-r--r--crypto/mdc2/mdc2dgst.c18
3 files changed, 12 insertions, 12 deletions
diff --git a/crypto/mdc2/mdc2.h b/crypto/mdc2/mdc2.h
index 793a8a0f13..6490e5c7d3 100644
--- a/crypto/mdc2/mdc2.h
+++ b/crypto/mdc2/mdc2.h
@@ -82,9 +82,9 @@ typedef struct mdc2_ctx_st
int MDC2_Init(MDC2_CTX *c);
-int MDC2_Update(MDC2_CTX *c, const unsigned char *data, unsigned long len);
+int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len);
int MDC2_Final(unsigned char *md, MDC2_CTX *c);
-unsigned char *MDC2(const unsigned char *d, unsigned long n,
+unsigned char *MDC2(const unsigned char *d, size_t n,
unsigned char *md);
#ifdef __cplusplus
diff --git a/crypto/mdc2/mdc2_one.c b/crypto/mdc2/mdc2_one.c
index 37f06c8d77..cd569aa865 100644
--- a/crypto/mdc2/mdc2_one.c
+++ b/crypto/mdc2/mdc2_one.c
@@ -60,7 +60,7 @@
#include "cryptlib.h"
#include <openssl/mdc2.h>
-unsigned char *MDC2(const unsigned char *d, unsigned long n, unsigned char *md)
+unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md)
{
MDC2_CTX c;
static unsigned char m[MDC2_DIGEST_LENGTH];
diff --git a/crypto/mdc2/mdc2dgst.c b/crypto/mdc2/mdc2dgst.c
index 32daa9b0da..aa9ba0ee6b 100644
--- a/crypto/mdc2/mdc2dgst.c
+++ b/crypto/mdc2/mdc2dgst.c
@@ -74,7 +74,7 @@
*((c)++)=(unsigned char)(((l)>>16L)&0xff), \
*((c)++)=(unsigned char)(((l)>>24L)&0xff))
-static void mdc2_body(MDC2_CTX *c, const unsigned char *in, unsigned int len);
+static void mdc2_body(MDC2_CTX *c, const unsigned char *in, size_t len);
int MDC2_Init(MDC2_CTX *c)
{
c->num=0;
@@ -84,9 +84,9 @@ int MDC2_Init(MDC2_CTX *c)
return 1;
}
-int MDC2_Update(MDC2_CTX *c, const unsigned char *in, unsigned long len)
+int MDC2_Update(MDC2_CTX *c, const unsigned char *in, size_t len)
{
- int i,j;
+ size_t i,j;
i=c->num;
if (i != 0)
@@ -94,7 +94,7 @@ int MDC2_Update(MDC2_CTX *c, const unsigned char *in, unsigned long len)
if (i+len < MDC2_BLOCK)
{
/* partial block */
- memcpy(&(c->data[i]),in,(int)len);
+ memcpy(&(c->data[i]),in,len);
c->num+=(int)len;
return 1;
}
@@ -109,25 +109,25 @@ int MDC2_Update(MDC2_CTX *c, const unsigned char *in, unsigned long len)
mdc2_body(c,&(c->data[0]),MDC2_BLOCK);
}
}
- i=(int)(len&(unsigned long)~(MDC2_BLOCK-1));
+ i=len&~((size_t)MDC2_BLOCK-1);
if (i > 0) mdc2_body(c,in,i);
- j=(int)len-i;
+ j=len-i;
if (j > 0)
{
memcpy(&(c->data[0]),&(in[i]),j);
- c->num=j;
+ c->num=(int)j;
}
return 1;
}
-static void mdc2_body(MDC2_CTX *c, const unsigned char *in, unsigned int len)
+static void mdc2_body(MDC2_CTX *c, const unsigned char *in, size_t len)
{
register DES_LONG tin0,tin1;
register DES_LONG ttin0,ttin1;
DES_LONG d[2],dd[2];
DES_key_schedule k;
unsigned char *p;
- unsigned int i;
+ size_t i;
for (i=0; i<len; i+=8)
{