diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-11 04:38:04 +0300 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-11-11 04:38:04 +0300 |
commit | e9b9a19ad30e004b3532105af417e43575ce7779 (patch) | |
tree | 149fe884916ee0be75e384fbcbb908695499c8d7 /libbb/sha1.c | |
parent | 6f05874b9dc4623512878566d144b0905700525d (diff) |
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
Diffstat (limited to 'libbb/sha1.c')
-rw-r--r-- | libbb/sha1.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/libbb/sha1.c b/libbb/sha1.c index fa468a295..76d5c8fbb 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; } |