From e9b9a19ad30e004b3532105af417e43575ce7779 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 11 Nov 2008 01:38:04 +0000 Subject: libbb: disable a second md5 implementation which managed to creep in :) function old new delta sha512_end 239 237 -2 sha256_end 162 160 -2 sha1_end 191 189 -2 md5_end 168 166 -2 __md5__magic 4 - -4 md5_crypt 627 621 -6 static.S 16 - -16 __md5_Init 42 - -42 static.P 64 - -64 __md5_Final 131 - -131 __md5_Update 153 - -153 static.C 268 12 -256 __md5_Transform 293 - -293 ------------------------------------------------------------------------------ (add/remove: 0/7 grow/shrink: 0/6 up/down: 0/-973) Total: -973 bytes --- libbb/sha1.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'libbb/sha1.c') diff --git a/libbb/sha1.c b/libbb/sha1.c index fa468a2..76d5c8f 100644 --- a/libbb/sha1.c +++ b/libbb/sha1.c @@ -546,7 +546,7 @@ void FAST_FUNC sha512_hash(const void *buffer, size_t len, sha512_ctx_t *ctx) } -void* FAST_FUNC sha1_end(void *resbuf, sha1_ctx_t *ctx) +void FAST_FUNC sha1_end(void *resbuf, sha1_ctx_t *ctx) { /* SHA1 Final padding and digest calculation */ #if BB_BIG_ENDIAN @@ -593,8 +593,6 @@ void* FAST_FUNC sha1_end(void *resbuf, sha1_ctx_t *ctx) /* misaligned for 32-bit words */ for (i = 0; i < SHA1_DIGEST_SIZE; ++i) hval[i] = (unsigned char) (ctx->hash[i >> 2] >> 8 * (~i & 3)); - - return resbuf; } @@ -603,7 +601,7 @@ void* FAST_FUNC sha1_end(void *resbuf, sha1_ctx_t *ctx) IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ -void* FAST_FUNC sha256_end(void *resbuf, sha256_ctx_t *ctx) +void FAST_FUNC sha256_end(void *resbuf, sha256_ctx_t *ctx) { /* Take yet unprocessed bytes into account. */ uint32_t bytes = ctx->buflen; @@ -630,8 +628,6 @@ void* FAST_FUNC sha256_end(void *resbuf, sha256_ctx_t *ctx) /* Put result from CTX in first 32 bytes following RESBUF. */ for (unsigned i = 0; i < 8; ++i) ((uint32_t *) resbuf)[i] = ntohl(ctx->H[i]); - - return resbuf; } /* Process the remaining bytes in the internal buffer and the usual @@ -639,7 +635,7 @@ void* FAST_FUNC sha256_end(void *resbuf, sha256_ctx_t *ctx) IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 64 bits value. */ -void* FAST_FUNC sha512_end(void *resbuf, sha512_ctx_t *ctx) +void FAST_FUNC sha512_end(void *resbuf, sha512_ctx_t *ctx) { /* Take yet unprocessed bytes into account. */ uint64_t bytes = ctx->buflen; @@ -666,6 +662,4 @@ void* FAST_FUNC sha512_end(void *resbuf, sha512_ctx_t *ctx) /* Put result from CTX in first 64 bytes following RESBUF. */ for (unsigned i = 0; i < 8; ++i) ((uint64_t *) resbuf)[i] = hton64(ctx->H[i]); - - return resbuf; } -- cgit v1.1