# HG changeset patch # User lu_zero # Date 1151925082 0 # Node ID 01299a828431677dfd4f635e00a40a2f9535cc46 # Parent 7df307dfe85c7c506708c46d8e8eeb78a8ba000a fix endianess build in a better way diff -r 7df307dfe85c -r 01299a828431 md5.c --- a/md5.c Mon Jul 03 10:52:07 2006 +0000 +++ b/md5.c Mon Jul 03 11:11:22 2006 +0000 @@ -69,11 +69,8 @@ }\ a = b + (( a << t ) | ( a >> (32 - t) )); -#ifdef WORDS_BIGENDIAN static void body(uint32_t ABCD[4], uint32_t X[16]){ -#else -static void body(uint32_t ABCD[4], const uint32_t X[16]){ -#endif + int t; int i attribute_unused; unsigned int a= ABCD[3]; @@ -121,7 +118,7 @@ for( i = 0; i < len; i++ ){ ctx->block[ ctx->b_used++ ] = src[i]; if( 64 == ctx->b_used ){ - body(ctx->ABCD, (const uint32_t*) ctx->block); + body(ctx->ABCD, (uint32_t*) ctx->block); ctx->b_used = 0; } } @@ -135,14 +132,14 @@ memset(&ctx->block[ctx->b_used], 0, 64 - ctx->b_used); if( 56 < ctx->b_used ){ - body( ctx->ABCD, (const uint32_t*) ctx->block ); + body( ctx->ABCD, (uint32_t*) ctx->block ); memset(ctx->block, 0, 64); } for(i=0; i<8; i++) ctx->block[56+i] = (ctx->len << 3) >> (i<<3); - body(ctx->ABCD, (const uint32_t*) ctx->block); + body(ctx->ABCD, (uint32_t*) ctx->block); for(i=0; i<4; i++) ((uint32_t*)dst)[i]= le2me_32(ctx->ABCD[3-i]);