diff options
Diffstat (limited to 'include/libbb.h')
-rw-r--r-- | include/libbb.h | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/include/libbb.h b/include/libbb.h index b04488a54..b6eab6f24 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1321,24 +1321,21 @@ 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 hash[8]; /* 5, +3 elements for sha256 */ | ||
1324 | uint64_t total64; | 1325 | uint64_t total64; |
1325 | uint8_t wbuffer[64]; /* NB: always correctly aligned for uint64_t */ | 1326 | uint8_t wbuffer[64]; /* NB: always correctly aligned for uint64_t */ |
1326 | uint32_t hash[5]; | 1327 | void (*process_block)(struct sha1_ctx_t*); |
1327 | } sha1_ctx_t; | 1328 | } sha1_ctx_t; |
1328 | void sha1_begin(sha1_ctx_t *ctx) FAST_FUNC; | 1329 | 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; | 1330 | 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; | 1331 | void sha1_end(void *resbuf, sha1_ctx_t *ctx) FAST_FUNC; |
1331 | typedef struct sha256_ctx_t { | 1332 | typedef struct sha1_ctx_t sha256_ctx_t; |
1332 | uint64_t total64; | ||
1333 | uint32_t hash[8]; | ||
1334 | uint8_t wbuffer[64]; /* NB: always correctly aligned for uint64_t */ | ||
1335 | } sha256_ctx_t; | ||
1336 | void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC; | 1333 | void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC; |
1337 | void sha256_hash(const void *buffer, size_t len, sha256_ctx_t *ctx) FAST_FUNC; | 1334 | #define sha256_hash sha1_hash |
1338 | void sha256_end(void *resbuf, sha256_ctx_t *ctx) FAST_FUNC; | 1335 | #define sha256_end sha1_end |
1339 | typedef struct sha512_ctx_t { | 1336 | typedef struct sha512_ctx_t { |
1340 | uint64_t total64[2]; | ||
1341 | uint64_t hash[8]; | 1337 | uint64_t hash[8]; |
1338 | uint64_t total64[2]; | ||
1342 | uint8_t wbuffer[128]; /* NB: always correctly aligned for uint64_t */ | 1339 | uint8_t wbuffer[128]; /* NB: always correctly aligned for uint64_t */ |
1343 | } sha512_ctx_t; | 1340 | } sha512_ctx_t; |
1344 | void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; | 1341 | void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; |