aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 839a0de49..85a915ec1 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1309,7 +1309,7 @@ typedef struct sha1_ctx_t {
1309} sha1_ctx_t; 1309} sha1_ctx_t;
1310void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC; 1310void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC;
1311void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx) FAST_FUNC; 1311void sha1_hash(const void *data, size_t length, sha1_ctx_t *ctx) FAST_FUNC;
1312void *sha1_end(void *resbuf, sha1_ctx_t *ctx) FAST_FUNC; 1312void sha1_end(void *resbuf, sha1_ctx_t *ctx) FAST_FUNC;
1313typedef struct sha256_ctx_t { 1313typedef struct sha256_ctx_t {
1314 uint32_t H[8]; 1314 uint32_t H[8];
1315 uint32_t total[2]; /* rename to "count"? */ 1315 uint32_t total[2]; /* rename to "count"? */
@@ -1318,7 +1318,7 @@ typedef struct sha256_ctx_t {
1318} sha256_ctx_t; 1318} sha256_ctx_t;
1319void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC; 1319void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC;
1320void sha256_hash(const void *buffer, size_t len, sha256_ctx_t *ctx) FAST_FUNC; 1320void sha256_hash(const void *buffer, size_t len, sha256_ctx_t *ctx) FAST_FUNC;
1321void* sha256_end(void *resbuf, sha256_ctx_t *ctx) FAST_FUNC; 1321void sha256_end(void *resbuf, sha256_ctx_t *ctx) FAST_FUNC;
1322typedef struct sha512_ctx_t { 1322typedef struct sha512_ctx_t {
1323 uint64_t H[8]; 1323 uint64_t H[8];
1324 uint64_t total[2]; 1324 uint64_t total[2];
@@ -1327,7 +1327,8 @@ typedef struct sha512_ctx_t {
1327} sha512_ctx_t; 1327} sha512_ctx_t;
1328void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; 1328void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC;
1329void sha512_hash(const void *buffer, size_t len, sha512_ctx_t *ctx) FAST_FUNC; 1329void sha512_hash(const void *buffer, size_t len, sha512_ctx_t *ctx) FAST_FUNC;
1330void* sha512_end(void *resbuf, sha512_ctx_t *ctx) FAST_FUNC; 1330void sha512_end(void *resbuf, sha512_ctx_t *ctx) FAST_FUNC;
1331#if 1
1331typedef struct md5_ctx_t { 1332typedef struct md5_ctx_t {
1332 uint32_t A; 1333 uint32_t A;
1333 uint32_t B; 1334 uint32_t B;
@@ -1337,9 +1338,18 @@ typedef struct md5_ctx_t {
1337 uint32_t buflen; 1338 uint32_t buflen;
1338 char buffer[128]; 1339 char buffer[128];
1339} md5_ctx_t; 1340} md5_ctx_t;
1341#else
1342/* libbb/md5prime.c uses a bit different one: */
1343typedef struct md5_ctx_t {
1344 uint32_t state[4]; /* state (ABCD) */
1345 uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */
1346 unsigned char buffer[64]; /* input buffer */
1347} md5_ctx_t;
1348#endif
1340void md5_begin(md5_ctx_t *ctx) FAST_FUNC; 1349void md5_begin(md5_ctx_t *ctx) FAST_FUNC;
1341void md5_hash(const void *data, size_t length, md5_ctx_t *ctx) FAST_FUNC; 1350void md5_hash(const void *data, size_t length, md5_ctx_t *ctx) FAST_FUNC;
1342void *md5_end(void *resbuf, md5_ctx_t *ctx) FAST_FUNC; 1351void md5_end(void *resbuf, md5_ctx_t *ctx) FAST_FUNC;
1352
1343 1353
1344uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC; 1354uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC;
1345 1355