diff --git a/engine/common/common.h b/engine/common/common.h index 230c07664..d26f4f3ed 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -326,7 +326,7 @@ void Info_SetValueForKey (char *s, const char *key, const char *value, int maxsi void Info_SetValueForStarKey (char *s, const char *key, const char *value, int maxsize); void Info_Print (char *s); -unsigned Com_BlockChecksum (void *buffer, int length); +unsigned int Com_BlockChecksum (void *buffer, int length); void Com_BlockFullChecksum (void *buffer, int len, unsigned char *outbuf); qbyte COM_BlockSequenceCheckByte (qbyte *base, int length, int sequence, unsigned mapchecksum); qbyte COM_BlockSequenceCRCByte (qbyte *base, int length, int sequence); diff --git a/engine/common/md4.c b/engine/common/md4.c index 7932d4a06..3c618e380 100644 --- a/engine/common/md4.c +++ b/engine/common/md4.c @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -34,17 +34,17 @@ typedef unsigned int UINT4; typedef unsigned long int UINT4; #endif - + /* MD4.H - header file for MD4C.C */ -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. +/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. - -License to copy and use this software is granted provided that it is identified as the “RSA Data Security, Inc. MD4 Message-Digest Algorithm” in all material mentioning or referencing this software or this function. -License is also granted to make and use derivative works provided that such works are identified as “derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm” in all material mentioning or referencing the derived work. -RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided “as is” without express or implied warranty of any kind. - + +License to copy and use this software is granted provided that it is identified as the RSA Data Security, Inc. MD4 Message-Digest Algorithm in all material mentioning or referencing this software or this function. +License is also granted to make and use derivative works provided that such works are identified as derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm in all material mentioning or referencing the derived work. +RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided as is without express or implied warranty of any kind. + These notices must be retained in any copies of any part of this documentation and/or software. */ /* MD4 context. */ @@ -57,21 +57,21 @@ typedef struct { void MD4Init (MD4_CTX *); void MD4Update (MD4_CTX *, unsigned char *, unsigned int); void MD4Final (unsigned char [16], MD4_CTX *); - - + + /* MD4C.C - RSA Data Security, Inc., MD4 message-digest algorithm */ /* Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved. - + License to copy and use this software is granted provided that it is identified as the RSA Data Security, Inc. MD4 Message-Digest Algorithm in all material mentioning or referencing this software or this function. -License is also granted to make and use derivative works provided that such works are identified as +License is also granted to make and use derivative works provided that such works are identified as derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided as is without express or implied warranty of any kind. - + These notices must be retained in any copies of any part of this documentation and/or software. */ /* Constants for MD4Transform routine. */ @@ -176,7 +176,7 @@ void MD4Final (unsigned char digest[16], MD4_CTX *context) /* Append length (before padding) */ MD4Update (context, bits, 8); - + /* Store state in digest */ Encode (digest, context->state, 16); @@ -281,16 +281,16 @@ for (i = 0, j = 0; j < len; i++, j += 4) //=================================================================== -unsigned Com_BlockChecksum (void *buffer, int length) +unsigned int Com_BlockChecksum (void *buffer, int length) { - int digest[4]; - unsigned val; + unsigned int digest[4]; + unsigned int val; MD4_CTX ctx; MD4Init (&ctx); MD4Update (&ctx, (unsigned char *)buffer, length); MD4Final ( (unsigned char *)digest, &ctx); - + val = digest[0] ^ digest[1] ^ digest[2] ^ digest[3]; return val;