diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-27 15:26:45 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-27 15:26:45 +0200 |
commit | 9ce642f9746dfc29d119d0680b769677e3ea6da6 (patch) | |
tree | f8d2bcd08c691979058b610b32573a742a3e3024 /include | |
parent | dd88ba88f5082b1785539b1fb87af7320515b8c9 (diff) | |
download | busybox-w32-9ce642f9746dfc29d119d0680b769677e3ea6da6.tar.gz busybox-w32-9ce642f9746dfc29d119d0680b769677e3ea6da6.tar.bz2 busybox-w32-9ce642f9746dfc29d119d0680b769677e3ea6da6.zip |
libbb: introduce and use common crc32 routine
function old new delta
crc32_block_endian1 - 37 +37
crc32_block_endian0 - 34 +34
global_crc32_table - 8 +8
file_read 82 87 +5
gzip_main 211 214 +3
xz_crc32 40 35 -5
crc32_table 8 - -8
calculate_gunzip_crc 54 34 -20
lzo_crc32 54 25 -29
cksum_main 298 211 -87
------------------------------------------------------------------------------
(add/remove: 3/1 grow/shrink: 2/4 up/down: 87/-149) Total: -62 bytes
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/libbb.h b/include/libbb.h index d14728ed0..587a5f952 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1543,11 +1543,10 @@ void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; | |||
1543 | void sha512_hash(sha512_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; | 1543 | void sha512_hash(sha512_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; |
1544 | void sha512_end(sha512_ctx_t *ctx, void *resbuf) FAST_FUNC; | 1544 | void sha512_end(sha512_ctx_t *ctx, void *resbuf) FAST_FUNC; |
1545 | 1545 | ||
1546 | /* TODO: add global crc32_table pointer and create | 1546 | extern uint32_t *global_crc32_table; |
1547 | * LE and BE functions to calculate crc32 over given bytes. | ||
1548 | * Currently we have about five reimplementations... | ||
1549 | */ | ||
1550 | uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC; | 1547 | uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC; |
1548 | uint32_t crc32_block_endian1(uint32_t val, const void *buf, unsigned len, uint32_t *crc_table) FAST_FUNC; | ||
1549 | uint32_t crc32_block_endian0(uint32_t val, const void *buf, unsigned len, uint32_t *crc_table) FAST_FUNC; | ||
1551 | 1550 | ||
1552 | typedef struct masks_labels_t { | 1551 | typedef struct masks_labels_t { |
1553 | const char *labels; | 1552 | const char *labels; |