From b8173b603f57dcf918a67f1ec00763ab5f4e1cf8 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Mon, 14 Jan 2013 05:20:50 +0100 Subject: sha3sum: new applet function old new delta KeccakF - 496 +496 KeccakF_RoundConstants - 192 +192 sha3_hash - 171 +171 sha3_end - 40 +40 hash_file 274 299 +25 KeccakF_RotationConstants - 25 +25 KeccakF_PiLane - 25 +25 packed_usage 29213 29232 +19 sha3_begin - 18 +18 KeccakF_Mod5 - 10 +10 applet_names 2445 2453 +8 applet_main 1420 1424 +4 applet_nameofs 710 712 +2 ------------------------------------------------------------------------------ (add/remove: 8/0 grow/shrink: 9/7 up/down: 1049/-54) Total: ~995 bytes Signed-off-by: Lauri Kasanen Signed-off-by: Denys Vlasenko --- include/libbb.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/libbb.h') diff --git a/include/libbb.h b/include/libbb.h index 2059567e0..6ac7d2cab 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1636,6 +1636,10 @@ typedef struct sha512_ctx_t { uint64_t hash[8]; uint8_t wbuffer[128]; /* always correctly aligned for uint64_t */ } sha512_ctx_t; +typedef struct sha3_ctx_t { + uint64_t state[25]; + unsigned bytes_queued; +} sha3_ctx_t; void md5_begin(md5_ctx_t *ctx) FAST_FUNC; void md5_hash(md5_ctx_t *ctx, const void *data, size_t length) FAST_FUNC; void md5_end(md5_ctx_t *ctx, void *resbuf) FAST_FUNC; @@ -1648,6 +1652,9 @@ void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC; void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; void sha512_hash(sha512_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; void sha512_end(sha512_ctx_t *ctx, void *resbuf) FAST_FUNC; +void sha3_begin(sha3_ctx_t *ctx) FAST_FUNC; +void sha3_hash(sha3_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; +void sha3_end(sha3_ctx_t *ctx, uint8_t *resbuf) FAST_FUNC; extern uint32_t *global_crc32_table; uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC; -- cgit v1.2.3