aboutsummaryrefslogtreecommitdiff
path: root/libbb/sha1.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-27 02:52:20 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-27 02:52:20 +0000
commitdefc1ea34074e7882724c460260d307cdf981a70 (patch)
treefca9b9a5fe243f9c0c76b84824ea2ff92ea8e589 /libbb/sha1.c
parent26bc57d8b26425f23f4be974cce7bf35c95c9a1a (diff)
downloadbusybox-w32-defc1ea34074e7882724c460260d307cdf981a70.tar.gz
busybox-w32-defc1ea34074e7882724c460260d307cdf981a70.tar.bz2
busybox-w32-defc1ea34074e7882724c460260d307cdf981a70.zip
*: introduce and use FAST_FUNC: regparm on i386, otherwise no-on
text data bss dec hex filename 808035 611 6868 815514 c719a busybox_old 804472 611 6868 811951 c63af busybox_unstripped
Diffstat (limited to 'libbb/sha1.c')
-rw-r--r--libbb/sha1.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libbb/sha1.c b/libbb/sha1.c
index 552dcad80..cc7edd8a7 100644
--- a/libbb/sha1.c
+++ b/libbb/sha1.c
@@ -83,7 +83,7 @@ static void sha1_compile(sha1_ctx_t *ctx)
83 ctx->hash[4] += e; 83 ctx->hash[4] += e;
84} 84}
85 85
86void sha1_begin(sha1_ctx_t *ctx) 86void FAST_FUNC sha1_begin(sha1_ctx_t *ctx)
87{ 87{
88 ctx->count[0] = ctx->count[1] = 0; 88 ctx->count[0] = ctx->count[1] = 0;
89 ctx->hash[0] = 0x67452301; 89 ctx->hash[0] = 0x67452301;
@@ -95,7 +95,7 @@ void sha1_begin(sha1_ctx_t *ctx)
95 95
96/* SHA1 hash data in an array of bytes into hash buffer and call the */ 96/* SHA1 hash data in an array of bytes into hash buffer and call the */
97/* hash_compile function as required. */ 97/* hash_compile function as required. */
98void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx) 98void FAST_FUNC sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx)
99{ 99{
100 uint32_t pos = (uint32_t) (ctx->count[0] & SHA1_MASK); 100 uint32_t pos = (uint32_t) (ctx->count[0] & SHA1_MASK);
101 uint32_t freeb = SHA1_BLOCK_SIZE - pos; 101 uint32_t freeb = SHA1_BLOCK_SIZE - pos;
@@ -116,7 +116,7 @@ void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx)
116 memcpy(((unsigned char *) ctx->wbuf) + pos, sp, length); 116 memcpy(((unsigned char *) ctx->wbuf) + pos, sp, length);
117} 117}
118 118
119void *sha1_end(void *resbuf, sha1_ctx_t *ctx) 119void* FAST_FUNC sha1_end(void *resbuf, sha1_ctx_t *ctx)
120{ 120{
121 /* SHA1 Final padding and digest calculation */ 121 /* SHA1 Final padding and digest calculation */
122#if BB_BIG_ENDIAN 122#if BB_BIG_ENDIAN