From 16ab8a93bc96cacc1b5376cc084f70122368ee1f Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sun, 25 Jul 2004 19:10:43 +0000 Subject: [PATCH] Minor 64-bit md32_common.h update and minor unsignification of digests. --- crypto/md2/md2.h | 2 +- crypto/md32_common.h | 6 +++--- crypto/md4/md4.h | 2 +- crypto/md5/md5.h | 2 +- crypto/mdc2/mdc2.h | 2 +- crypto/mdc2/mdc2dgst.c | 3 ++- crypto/ripemd/ripemd.h | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/crypto/md2/md2.h b/crypto/md2/md2.h index 45bf4cc29c..15bd40c7b7 100644 --- a/crypto/md2/md2.h +++ b/crypto/md2/md2.h @@ -73,7 +73,7 @@ extern "C" { typedef struct MD2state_st { - int num; + usigned int num; unsigned char data[MD2_BLOCK]; MD2_INT cksm[MD2_BLOCK]; MD2_INT state[MD2_BLOCK]; diff --git a/crypto/md32_common.h b/crypto/md32_common.h index 5bdcf035aa..7eef6e9074 100644 --- a/crypto/md32_common.h +++ b/crypto/md32_common.h @@ -77,7 +77,7 @@ * ... * HASH_LONG Nl,Nh; * HASH_LONG data[HASH_LBLOCK]; - * int num; + * unsigned int num; * ... * } HASH_CTX; * HASH_UPDATE @@ -398,7 +398,7 @@ int HASH_UPDATE (HASH_CTX *c, const void *data_, size_t len) const unsigned char *data=data_; register HASH_LONG * p; register HASH_LONG l; - unsigned int sw,sc,ew,ec; + size_t sw,sc,ew,ec; if (len==0) return 1; @@ -430,7 +430,7 @@ int HASH_UPDATE (HASH_CTX *c, const void *data_, size_t len) } else { - c->num+=len; + c->num+=(unsigned int)len; if ((sc+len) < 4) /* ugly, add char's to a word */ { l=p[sw]; HOST_p_c2l_p(data,l,sc,len); p[sw]=l; diff --git a/crypto/md4/md4.h b/crypto/md4/md4.h index 9a5b6603fe..b080cbdc21 100644 --- a/crypto/md4/md4.h +++ b/crypto/md4/md4.h @@ -101,7 +101,7 @@ typedef struct MD4state_st MD4_LONG A,B,C,D; MD4_LONG Nl,Nh; MD4_LONG data[MD4_LBLOCK]; - int num; + unsigned int num; } MD4_CTX; int MD4_Init(MD4_CTX *c); diff --git a/crypto/md5/md5.h b/crypto/md5/md5.h index 587d947b9a..a58940e547 100644 --- a/crypto/md5/md5.h +++ b/crypto/md5/md5.h @@ -101,7 +101,7 @@ typedef struct MD5state_st MD5_LONG A,B,C,D; MD5_LONG Nl,Nh; MD5_LONG data[MD5_LBLOCK]; - int num; + unigned int num; } MD5_CTX; int MD5_Init(MD5_CTX *c); diff --git a/crypto/mdc2/mdc2.h b/crypto/mdc2/mdc2.h index 6490e5c7d3..72778a5212 100644 --- a/crypto/mdc2/mdc2.h +++ b/crypto/mdc2/mdc2.h @@ -74,7 +74,7 @@ extern "C" { typedef struct mdc2_ctx_st { - int num; + unsigned int num; unsigned char data[MDC2_BLOCK]; DES_cblock h,hh; int pad_type; /* either 1 or 2, default 1 */ diff --git a/crypto/mdc2/mdc2dgst.c b/crypto/mdc2/mdc2dgst.c index aa9ba0ee6b..4aa406edc3 100644 --- a/crypto/mdc2/mdc2dgst.c +++ b/crypto/mdc2/mdc2dgst.c @@ -160,7 +160,8 @@ static void mdc2_body(MDC2_CTX *c, const unsigned char *in, size_t len) int MDC2_Final(unsigned char *md, MDC2_CTX *c) { - int i,j; + unsigned int i; + int j; i=c->num; j=c->pad_type; diff --git a/crypto/ripemd/ripemd.h b/crypto/ripemd/ripemd.h index a664e742af..06bd67183b 100644 --- a/crypto/ripemd/ripemd.h +++ b/crypto/ripemd/ripemd.h @@ -87,7 +87,7 @@ typedef struct RIPEMD160state_st RIPEMD160_LONG A,B,C,D,E; RIPEMD160_LONG Nl,Nh; RIPEMD160_LONG data[RIPEMD160_LBLOCK]; - int num; + unsigned int num; } RIPEMD160_CTX; int RIPEMD160_Init(RIPEMD160_CTX *c); -- 2.34.1