diff options
Diffstat (limited to 'include/libbb.h')
-rw-r--r-- | include/libbb.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/include/libbb.h b/include/libbb.h index 221837b64..9ece2f9ec 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1522,37 +1522,42 @@ unsigned get_cpu_count(void) FAST_FUNC; | |||
1522 | extern const char bb_uuenc_tbl_base64[]; | 1522 | extern const char bb_uuenc_tbl_base64[]; |
1523 | extern const char bb_uuenc_tbl_std[]; | 1523 | extern const char bb_uuenc_tbl_std[]; |
1524 | void bb_uuencode(char *store, const void *s, int length, const char *tbl) FAST_FUNC; | 1524 | void bb_uuencode(char *store, const void *s, int length, const char *tbl) FAST_FUNC; |
1525 | enum { | ||
1526 | BASE64_FLAG_UU_STOP = 0x100, | ||
1527 | /* Sign-extends to a value which never matches fgetc result: */ | ||
1528 | BASE64_FLAG_NO_STOP_CHAR = 0x80, | ||
1529 | }; | ||
1530 | void FAST_FUNC read_base64(FILE *src_stream, FILE *dst_stream, int flags); | ||
1525 | 1531 | ||
1526 | typedef struct sha1_ctx_t { | 1532 | typedef struct sha1_ctx_t { |
1527 | uint32_t hash[8]; /* 5, +3 elements for sha256 */ | 1533 | uint32_t hash[8]; /* 5, +3 elements for sha256 */ |
1528 | uint64_t total64; | 1534 | uint64_t total64; /* must be directly after hash[] */ |
1529 | uint8_t wbuffer[64]; /* NB: always correctly aligned for uint64_t */ | 1535 | uint8_t wbuffer[64]; /* NB: always correctly aligned for uint64_t */ |
1530 | void (*process_block)(struct sha1_ctx_t*) FAST_FUNC; | 1536 | void (*process_block)(struct sha1_ctx_t*) FAST_FUNC; |
1531 | } sha1_ctx_t; | 1537 | } sha1_ctx_t; |
1532 | void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC; | 1538 | void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC; |
1533 | void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx) FAST_FUNC; | 1539 | void sha1_hash(sha1_ctx_t *ctx, const void *data, size_t length) FAST_FUNC; |
1534 | void sha1_end(void *resbuf, sha1_ctx_t *ctx) FAST_FUNC; | 1540 | void sha1_end(sha1_ctx_t *ctx, void *resbuf) FAST_FUNC; |
1535 | typedef struct sha1_ctx_t sha256_ctx_t; | 1541 | typedef struct sha1_ctx_t sha256_ctx_t; |
1536 | void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC; | 1542 | void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC; |
1537 | #define sha256_hash sha1_hash | 1543 | #define sha256_hash sha1_hash |
1538 | #define sha256_end sha1_end | 1544 | #define sha256_end sha1_end |
1539 | typedef struct sha512_ctx_t { | 1545 | typedef struct sha512_ctx_t { |
1540 | uint64_t hash[8]; | 1546 | uint64_t hash[8]; |
1541 | uint64_t total64[2]; | 1547 | uint64_t total64[2]; /* must be directly after hash[] */ |
1542 | uint8_t wbuffer[128]; /* NB: always correctly aligned for uint64_t */ | 1548 | uint8_t wbuffer[128]; /* NB: always correctly aligned for uint64_t */ |
1543 | } sha512_ctx_t; | 1549 | } sha512_ctx_t; |
1544 | void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; | 1550 | void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; |
1545 | void sha512_hash(const void *buffer, size_t len, sha512_ctx_t *ctx) FAST_FUNC; | 1551 | void sha512_hash(sha512_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; |
1546 | void sha512_end(void *resbuf, sha512_ctx_t *ctx) FAST_FUNC; | 1552 | void sha512_end(sha512_ctx_t *ctx, void *resbuf) FAST_FUNC; |
1547 | #if 1 | 1553 | #if 1 |
1548 | typedef struct md5_ctx_t { | 1554 | typedef struct md5_ctx_t { |
1549 | uint32_t A; | 1555 | uint32_t A; |
1550 | uint32_t B; | 1556 | uint32_t B; |
1551 | uint32_t C; | 1557 | uint32_t C; |
1552 | uint32_t D; | 1558 | uint32_t D; |
1553 | uint64_t total; | 1559 | uint64_t total64; |
1554 | uint32_t buflen; | 1560 | char wbuffer[64]; |
1555 | char buffer[128]; | ||
1556 | } md5_ctx_t; | 1561 | } md5_ctx_t; |
1557 | #else | 1562 | #else |
1558 | /* libbb/md5prime.c uses a bit different one: */ | 1563 | /* libbb/md5prime.c uses a bit different one: */ |
@@ -1563,8 +1568,8 @@ typedef struct md5_ctx_t { | |||
1563 | } md5_ctx_t; | 1568 | } md5_ctx_t; |
1564 | #endif | 1569 | #endif |
1565 | void md5_begin(md5_ctx_t *ctx) FAST_FUNC; | 1570 | void md5_begin(md5_ctx_t *ctx) FAST_FUNC; |
1566 | void md5_hash(const void *data, size_t length, md5_ctx_t *ctx) FAST_FUNC; | 1571 | void md5_hash(md5_ctx_t *ctx, const void *data, size_t length) FAST_FUNC; |
1567 | void md5_end(void *resbuf, md5_ctx_t *ctx) FAST_FUNC; | 1572 | void md5_end(md5_ctx_t *ctx, void *resbuf) FAST_FUNC; |
1568 | 1573 | ||
1569 | 1574 | ||
1570 | uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC; | 1575 | uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC; |