aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-01-29 22:33:28 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-01-29 22:33:28 +0000
commit51722db75c87209341f015b0b2fb3a64bacd4d60 (patch)
treecdbd981eeb7a839d477648a54cb0bcd20d8b180a /libbb
parentba6c3b6965197cecfa513c3ce34170b90209eb32 (diff)
downloadbusybox-w32-51722db75c87209341f015b0b2fb3a64bacd4d60.tar.gz
busybox-w32-51722db75c87209341f015b0b2fb3a64bacd4d60.tar.bz2
busybox-w32-51722db75c87209341f015b0b2fb3a64bacd4d60.zip
Apply a couple of optimizations
git-svn-id: svn://busybox.net/trunk/busybox@8363 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r--libbb/hash_fd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libbb/hash_fd.c b/libbb/hash_fd.c
index 770ba09c4..58394522f 100644
--- a/libbb/hash_fd.c
+++ b/libbb/hash_fd.c
@@ -95,9 +95,9 @@
95# define SHA1_MASK (SHA1_BLOCK_SIZE - 1) 95# define SHA1_MASK (SHA1_BLOCK_SIZE - 1)
96 96
97/* reverse byte order in 32-bit words */ 97/* reverse byte order in 32-bit words */
98# define ch(x,y,z) (((x) & (y)) ^ (~(x) & (z))) 98#define ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
99# define parity(x,y,z) ((x) ^ (y) ^ (z)) 99#define parity(x,y,z) ((x) ^ (y) ^ (z))
100# define maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) 100#define maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
101 101
102/* A normal version as set out in the FIPS. This version uses */ 102/* A normal version as set out in the FIPS. This version uses */
103/* partial loop unrolling and is optimised for the Pentium 4 */ 103/* partial loop unrolling and is optimised for the Pentium 4 */
@@ -276,6 +276,8 @@ void sha1_end(unsigned char hval[], sha1_ctx_t *ctx)
276/* Handle endian-ness */ 276/* Handle endian-ness */
277# if __BYTE_ORDER == __LITTLE_ENDIAN 277# if __BYTE_ORDER == __LITTLE_ENDIAN
278# define SWAP(n) (n) 278# define SWAP(n) (n)
279# elif defined(bswap_32)
280# define SWAP(n) bswap_32(n)
279# else 281# else
280# define SWAP(n) ((n << 24) | ((n&65280)<<8) | ((n&16711680)>>8) | (n>>24)) 282# define SWAP(n) ((n << 24) | ((n&65280)<<8) | ((n&16711680)>>8) | (n>>24))
281# endif 283# endif