diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-11 21:15:51 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-03-11 21:15:51 +0000 |
commit | 98c87f75755c1b53c8bd84f487e4bc7cba359b3e (patch) | |
tree | 7850459b7323f2f6cf338f0022009eea7c43748f /include | |
parent | 54ac03a61885c714b4ef606b0a09129b27f72626 (diff) | |
download | busybox-w32-98c87f75755c1b53c8bd84f487e4bc7cba359b3e.tar.gz busybox-w32-98c87f75755c1b53c8bd84f487e4bc7cba359b3e.tar.bz2 busybox-w32-98c87f75755c1b53c8bd84f487e4bc7cba359b3e.zip |
sha256/512: code shrink. Run-tested.
function old new delta
sha512_process_block128 - 1444 +1444
sha1_process_block64 - 542 +542
sha256_process_block64 - 529 +529
K512_lo - 320 +320
K256 - 320 +320
init512_lo - 32 +32
init256 - 32 +32
sha1_hash 99 128 +29
sha256_end 160 135 -25
sha1_end 189 160 -29
sha512_end 237 204 -33
sha256_begin 77 44 -33
sha512_begin 154 88 -66
sha256_hash 338 259 -79
sha512_hash 358 262 -96
sha1_compile 542 - -542
sha256_process_block 594 - -594
static.K 896 - -896
sha512_process_block 1861 - -1861
------------------------------------------------------------------------------
(add/remove: 7/4 grow/shrink: 1/7 up/down: 3248/-4254) Total: -1006 bytes
text data bss dec hex filename
808013 468 7856 816337 c74d1 busybox_old
807007 468 7856 815331 c70e3 busybox_unstripped
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/libbb.h b/include/libbb.h index 80a1c912c..4c9901027 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1321,27 +1321,27 @@ extern const char bb_uuenc_tbl_std[]; | |||
1321 | void bb_uuencode(char *store, const void *s, int length, const char *tbl) FAST_FUNC; | 1321 | void bb_uuencode(char *store, const void *s, int length, const char *tbl) FAST_FUNC; |
1322 | 1322 | ||
1323 | typedef struct sha1_ctx_t { | 1323 | typedef struct sha1_ctx_t { |
1324 | uint32_t count[2]; | 1324 | uint64_t total64; |
1325 | uint32_t wbuffer[16]; /* NB: always correctly aligned for uint64_t */ | ||
1325 | uint32_t hash[5]; | 1326 | uint32_t hash[5]; |
1326 | uint32_t wbuf[16]; | ||
1327 | } sha1_ctx_t; | 1327 | } sha1_ctx_t; |
1328 | void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC; | 1328 | void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC; |
1329 | void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx) FAST_FUNC; | 1329 | void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx) FAST_FUNC; |
1330 | void sha1_end(void *resbuf, sha1_ctx_t *ctx) FAST_FUNC; | 1330 | void sha1_end(void *resbuf, sha1_ctx_t *ctx) FAST_FUNC; |
1331 | typedef struct sha256_ctx_t { | 1331 | typedef struct sha256_ctx_t { |
1332 | unsigned wbuflen; | ||
1332 | uint32_t H[8]; | 1333 | uint32_t H[8]; |
1333 | uint32_t total[2]; /* rename to "count"? */ | 1334 | uint64_t total64; |
1334 | uint32_t buflen; | 1335 | char wbuffer[64*2]; /* NB: always correctly aligned for uint64_t */ |
1335 | char buffer[128]; /* NB: always correctly aligned for uint32_t */ | ||
1336 | } sha256_ctx_t; | 1336 | } sha256_ctx_t; |
1337 | void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC; | 1337 | void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC; |
1338 | void sha256_hash(const void *buffer, size_t len, sha256_ctx_t *ctx) FAST_FUNC; | 1338 | void sha256_hash(const void *buffer, size_t len, sha256_ctx_t *ctx) FAST_FUNC; |
1339 | void sha256_end(void *resbuf, sha256_ctx_t *ctx) FAST_FUNC; | 1339 | void sha256_end(void *resbuf, sha256_ctx_t *ctx) FAST_FUNC; |
1340 | typedef struct sha512_ctx_t { | 1340 | typedef struct sha512_ctx_t { |
1341 | unsigned wbuflen; | ||
1341 | uint64_t H[8]; | 1342 | uint64_t H[8]; |
1342 | uint64_t total[2]; | 1343 | uint64_t total64[2]; |
1343 | uint64_t buflen; | 1344 | char wbuffer[128*2]; /* NB: always correctly aligned for uint64_t */ |
1344 | char buffer[256]; /* NB: always correctly aligned for uint64_t */ | ||
1345 | } sha512_ctx_t; | 1345 | } sha512_ctx_t; |
1346 | void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; | 1346 | void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; |
1347 | void sha512_hash(const void *buffer, size_t len, sha512_ctx_t *ctx) FAST_FUNC; | 1347 | void sha512_hash(const void *buffer, size_t len, sha512_ctx_t *ctx) FAST_FUNC; |