diff --git a/lib/des/md4.c b/lib/des/md4.c index 1b032149d..04468868d 100644 --- a/lib/des/md4.c +++ b/lib/des/md4.c @@ -159,10 +159,10 @@ calc (struct md4 *m, u_int32_t *data) * From `Performance analysis of MD5' by Joseph D. Touch */ +#if defined(WORDS_BIGENDIAN) static inline u_int32_t swap_u_int32_t (u_int32_t t) { -#if defined(WORDS_BIGENDIAN) u_int32_t temp1, temp2; temp1 = cshift(t, 16); @@ -171,10 +171,8 @@ swap_u_int32_t (u_int32_t t) temp2 &= 0x00ff00ff; temp1 <<= 8; return temp1 | temp2; -#else - return t; -#endif } +#endif struct x32{ unsigned int a:32; diff --git a/lib/des/md5.c b/lib/des/md5.c index 39c5428d0..bfada0ae4 100644 --- a/lib/des/md5.c +++ b/lib/des/md5.c @@ -183,10 +183,10 @@ calc (struct md5 *m, u_int32_t *data) * From `Performance analysis of MD5' by Joseph D. Touch */ +#if defined(WORDS_BIGENDIAN) static inline u_int32_t swap_u_int32_t (u_int32_t t) { -#if defined(WORDS_BIGENDIAN) u_int32_t temp1, temp2; temp1 = cshift(t, 16); @@ -195,10 +195,8 @@ swap_u_int32_t (u_int32_t t) temp2 &= 0x00ff00ff; temp1 <<= 8; return temp1 | temp2; -#else - return t; -#endif } +#endif struct x32{ unsigned int a:32; diff --git a/lib/des/sha.c b/lib/des/sha.c index 9085e770c..16fd7c8d5 100644 --- a/lib/des/sha.c +++ b/lib/des/sha.c @@ -208,10 +208,10 @@ calc (struct sha *m, u_int32_t *in) * From `Performance analysis of MD5' by Joseph D. Touch */ +#if !defined(WORDS_BIGENDIAN) static inline u_int32_t swap_u_int32_t (u_int32_t t) { -#if !defined(WORDS_BIGENDIAN) #define ROL(x,n) ((x)<<(n))|((x)>>(32-(n))) u_int32_t temp1, temp2; @@ -221,10 +221,8 @@ swap_u_int32_t (u_int32_t t) temp2 &= 0x00ff00ff; temp1 <<= 8; return temp1 | temp2; -#else - return t; -#endif } +#endif struct x32{ unsigned int a:32;