aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/mdc2/mdc2dgst.c
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/mdc2dgst.c
parent1c7a0e2856bce20267174375fd66007fa172354d (diff)
downloadopenssl-9e0aad9fd60635e240f7742fa1497eced6f1cd0b.tar.gz
size_t-fication of message digest APIs. We should size_t-fy more APIs...
Diffstat (limited to 'crypto/mdc2/mdc2dgst.c')
-rw-r--r--crypto/mdc2/mdc2dgst.c18
1 files changed, 9 insertions, 9 deletions
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)
{