aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-03-12 15:40:27 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-03-12 15:40:27 +0000
commitcd2cd312b70e53b2095827d84c675b85cef4d2f6 (patch)
treea005300276c4c0943319c70a957474108ac89ef2 /include
parent6a5d9faa29e5ccf9467d25388dfaabaf0794e7bd (diff)
downloadbusybox-w32-cd2cd312b70e53b2095827d84c675b85cef4d2f6.tar.gz
busybox-w32-cd2cd312b70e53b2095827d84c675b85cef4d2f6.tar.bz2
busybox-w32-cd2cd312b70e53b2095827d84c675b85cef4d2f6.zip
shrink sha hashing a bit more (remove wbuflen field from ctx),
remove the requirement for aligned buffer function old new delta sha512_hash 262 297 +35 sha1_end 136 143 +7 passwd_main 1019 1023 +4 sha256_end 135 137 +2 count_lines 72 74 +2 sha256_hash 259 260 +1 popstring 164 158 -6 sha512_begin 88 81 -7 sha256_begin 44 37 -7 parse_expr 832 824 -8 bbunpack 446 438 -8 sha256_process_block64 529 520 -9 md5_end 166 151 -15 evaltreenr 817 802 -15 evaltree 817 802 -15 sha512_end 204 182 -22 sha512_process_block128 1444 1405 -39 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/11 up/down: 51/-151) Total: -100 bytes
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 4c9901027..3f566f8af 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1329,18 +1329,16 @@ void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC;
1329void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx) FAST_FUNC; 1329void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx) FAST_FUNC;
1330void sha1_end(void *resbuf, sha1_ctx_t *ctx) FAST_FUNC; 1330void sha1_end(void *resbuf, sha1_ctx_t *ctx) FAST_FUNC;
1331typedef struct sha256_ctx_t { 1331typedef struct sha256_ctx_t {
1332 unsigned wbuflen;
1333 uint32_t H[8];
1334 uint64_t total64; 1332 uint64_t total64;
1333 uint32_t hash[8];
1335 char wbuffer[64*2]; /* NB: always correctly aligned for uint64_t */ 1334 char wbuffer[64*2]; /* NB: always correctly aligned for uint64_t */
1336} sha256_ctx_t; 1335} sha256_ctx_t;
1337void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC; 1336void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC;
1338void sha256_hash(const void *buffer, size_t len, sha256_ctx_t *ctx) FAST_FUNC; 1337void sha256_hash(const void *buffer, size_t len, sha256_ctx_t *ctx) FAST_FUNC;
1339void sha256_end(void *resbuf, sha256_ctx_t *ctx) FAST_FUNC; 1338void sha256_end(void *resbuf, sha256_ctx_t *ctx) FAST_FUNC;
1340typedef struct sha512_ctx_t { 1339typedef struct sha512_ctx_t {
1341 unsigned wbuflen;
1342 uint64_t H[8];
1343 uint64_t total64[2]; 1340 uint64_t total64[2];
1341 uint64_t hash[8];
1344 char wbuffer[128*2]; /* NB: always correctly aligned for uint64_t */ 1342 char wbuffer[128*2]; /* NB: always correctly aligned for uint64_t */
1345} sha512_ctx_t; 1343} sha512_ctx_t;
1346void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; 1344void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC;