3535 * compile-time configuration.
3636 */
3737
38- #ifndef HAVE_OPENSSL
39-
4038#include <string.h>
4139
42- #include "md5 .h"
40+ #include "cmd5 .h"
4341
4442/*
4543 * The basic MD5 functions.
7977 */
8078#if defined(__i386__ ) || defined(__x86_64__ ) || defined(__vax__ )
8179#define SET (n ) \
82- (*(MD5_u32plus *)&ptr[(n) * 4])
80+ (*(CMD5_u32plus *)&ptr[(n) * 4])
8381#define GET (n ) \
8482SET(n)
8583#else
8684#define SET (n ) \
8785(ctx->block[(n)] = \
88- (MD5_u32plus )ptr[(n) * 4] | \
89- ((MD5_u32plus )ptr[(n) * 4 + 1] << 8) | \
90- ((MD5_u32plus )ptr[(n) * 4 + 2] << 16) | \
91- ((MD5_u32plus )ptr[(n) * 4 + 3] << 24))
86+ (CMD5_u32plus )ptr[(n) * 4] | \
87+ ((CMD5_u32plus )ptr[(n) * 4 + 1] << 8) | \
88+ ((CMD5_u32plus )ptr[(n) * 4 + 2] << 16) | \
89+ ((CMD5_u32plus )ptr[(n) * 4 + 3] << 24))
9290#define GET (n ) \
9391(ctx->block[(n)])
9492#endif
@@ -97,11 +95,11 @@ SET(n)
9795 * This processes one or more 64-byte data blocks, but does NOT update the bit
9896 * counters. There are no alignment requirements.
9997 */
100- static const void * body (MD5_CTX * ctx , const void * data , unsigned long size )
98+ static const void * body (CMD5_CTX * ctx , const void * data , unsigned long size )
10199{
102100 const unsigned char * ptr ;
103- MD5_u32plus a , b , c , d ;
104- MD5_u32plus saved_a , saved_b , saved_c , saved_d ;
101+ CMD5_u32plus a , b , c , d ;
102+ CMD5_u32plus saved_a , saved_b , saved_c , saved_d ;
105103
106104 ptr = (const unsigned char * )data ;
107105
@@ -204,7 +202,7 @@ static const void *body(MD5_CTX *ctx, const void *data, unsigned long size)
204202 return ptr ;
205203}
206204
207- void MD5_Init ( MD5_CTX * ctx )
205+ void CMD5_Init ( CMD5_CTX * ctx )
208206{
209207 ctx -> a = 0x67452301 ;
210208 ctx -> b = 0xefcdab89 ;
@@ -215,9 +213,9 @@ void MD5_Init(MD5_CTX *ctx)
215213 ctx -> hi = 0 ;
216214}
217215
218- void MD5_Update ( MD5_CTX * ctx , const void * data , unsigned long size )
216+ void CMD5_Update ( CMD5_CTX * ctx , const void * data , unsigned long size )
219217{
220- MD5_u32plus saved_lo ;
218+ CMD5_u32plus saved_lo ;
221219 unsigned long used , available ;
222220
223221 saved_lo = ctx -> lo ;
@@ -255,7 +253,7 @@ void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size)
255253(dst)[2] = (unsigned char)((src) >> 16); \
256254(dst)[3] = (unsigned char)((src) >> 24);
257255
258- void MD5_Final (unsigned char * result , MD5_CTX * ctx )
256+ void CMD5_Final (unsigned char * result , CMD5_CTX * ctx )
259257{
260258 unsigned long used , available ;
261259
@@ -287,5 +285,3 @@ void MD5_Final(unsigned char *result, MD5_CTX *ctx)
287285
288286 memset (ctx , 0 , sizeof (* ctx ));
289287}
290-
291- #endif
0 commit comments