projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Minor 64-bit md32_common.h update and minor unsignification of digests.
[openssl.git]
/
crypto
/
mdc2
/
mdc2dgst.c
diff --git
a/crypto/mdc2/mdc2dgst.c
b/crypto/mdc2/mdc2dgst.c
index 3a873d147a573edd620f623abcf22f4e21495e7e..4aa406edc3bab41e2dc9d46db2879b392a6c0b20 100644
(file)
--- 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))
*((c)++)=(unsigned char)(((l)>>16L)&0xff), \
*((c)++)=(unsigned char)(((l)>>24L)&0xff))
-static void mdc2_body(MDC2_CTX *c, const unsigned char *in,
unsigned in
t len);
+static void mdc2_body(MDC2_CTX *c, const unsigned char *in,
size_
t len);
int MDC2_Init(MDC2_CTX *c)
{
c->num=0;
int MDC2_Init(MDC2_CTX *c)
{
c->num=0;
@@
-84,9
+84,9
@@
int MDC2_Init(MDC2_CTX *c)
return 1;
}
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)
{
{
-
in
t i,j;
+
size_
t i,j;
i=c->num;
if (i != 0)
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 */
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;
}
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);
}
}
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);
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);
if (j > 0)
{
memcpy(&(c->data[0]),&(in[i]),j);
- c->num=j;
+ c->num=
(int)
j;
}
return 1;
}
}
return 1;
}
-static void mdc2_body(MDC2_CTX *c, const unsigned char *in,
unsigned in
t 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];
{
register DES_LONG tin0,tin1;
register DES_LONG ttin0,ttin1;
DES_LONG d[2],dd[2];
-
des
_key_schedule k;
+
DES
_key_schedule k;
unsigned char *p;
unsigned char *p;
-
unsigned in
t i;
+
size_
t i;
for (i=0; i<len; i+=8)
{
for (i=0; i<len; i+=8)
{
@@
-136,13
+136,13
@@
static void mdc2_body(MDC2_CTX *c, const unsigned char *in, unsigned int len)
c->h[0]=(c->h[0]&0x9f)|0x40;
c->hh[0]=(c->hh[0]&0x9f)|0x20;
c->h[0]=(c->h[0]&0x9f)|0x40;
c->hh[0]=(c->hh[0]&0x9f)|0x20;
-
des
_set_odd_parity(&c->h);
-
des_set_key_unchecked(&c->h,
k);
-
des_encrypt(d,
k,1);
+
DES
_set_odd_parity(&c->h);
+
DES_set_key_unchecked(&c->h,&
k);
+
DES_encrypt1(d,&
k,1);
-
des
_set_odd_parity(&c->hh);
-
des_set_key_unchecked(&c->hh,
k);
-
des_encrypt(dd,
k,1);
+
DES
_set_odd_parity(&c->hh);
+
DES_set_key_unchecked(&c->hh,&
k);
+
DES_encrypt1(dd,&
k,1);
ttin0=tin0^dd[0];
ttin1=tin1^dd[1];
ttin0=tin0^dd[0];
ttin1=tin1^dd[1];
@@
-160,7
+160,8
@@
static void mdc2_body(MDC2_CTX *c, const unsigned char *in, unsigned int len)
int MDC2_Final(unsigned char *md, MDC2_CTX *c)
{
int MDC2_Final(unsigned char *md, MDC2_CTX *c)
{
- int i,j;
+ unsigned int i;
+ int j;
i=c->num;
j=c->pad_type;
i=c->num;
j=c->pad_type;