diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/applets.src.h | 1 | ||||
-rw-r--r-- | include/libbb.h | 7 | ||||
-rw-r--r-- | include/platform.h | 5 |
3 files changed, 12 insertions, 1 deletions
diff --git a/include/applets.src.h b/include/applets.src.h index 597b1c9a6..29ab16706 100644 --- a/include/applets.src.h +++ b/include/applets.src.h | |||
@@ -328,6 +328,7 @@ IF_SETSEBOOL(APPLET(setsebool, BB_DIR_USR_SBIN, BB_SUID_DROP)) | |||
328 | IF_SETSID(APPLET(setsid, BB_DIR_USR_BIN, BB_SUID_DROP)) | 328 | IF_SETSID(APPLET(setsid, BB_DIR_USR_BIN, BB_SUID_DROP)) |
329 | IF_SETUIDGID(APPLET_ODDNAME(setuidgid, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, setuidgid)) | 329 | IF_SETUIDGID(APPLET_ODDNAME(setuidgid, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, setuidgid)) |
330 | IF_SHA1SUM(APPLET_NOEXEC(sha1sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha1sum)) | 330 | IF_SHA1SUM(APPLET_NOEXEC(sha1sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha1sum)) |
331 | IF_SHA3SUM(APPLET_NOEXEC(sha3sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha3sum)) | ||
331 | IF_SHA256SUM(APPLET_NOEXEC(sha256sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha256sum)) | 332 | IF_SHA256SUM(APPLET_NOEXEC(sha256sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha256sum)) |
332 | IF_SHA512SUM(APPLET_NOEXEC(sha512sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha512sum)) | 333 | IF_SHA512SUM(APPLET_NOEXEC(sha512sum, md5_sha1_sum, BB_DIR_USR_BIN, BB_SUID_DROP, sha512sum)) |
333 | IF_SHOWKEY(APPLET(showkey, BB_DIR_USR_BIN, BB_SUID_DROP)) | 334 | IF_SHOWKEY(APPLET(showkey, BB_DIR_USR_BIN, BB_SUID_DROP)) |
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 { | |||
1636 | uint64_t hash[8]; | 1636 | uint64_t hash[8]; |
1637 | uint8_t wbuffer[128]; /* always correctly aligned for uint64_t */ | 1637 | uint8_t wbuffer[128]; /* always correctly aligned for uint64_t */ |
1638 | } sha512_ctx_t; | 1638 | } sha512_ctx_t; |
1639 | typedef struct sha3_ctx_t { | ||
1640 | uint64_t state[25]; | ||
1641 | unsigned bytes_queued; | ||
1642 | } sha3_ctx_t; | ||
1639 | void md5_begin(md5_ctx_t *ctx) FAST_FUNC; | 1643 | void md5_begin(md5_ctx_t *ctx) FAST_FUNC; |
1640 | void md5_hash(md5_ctx_t *ctx, const void *data, size_t length) FAST_FUNC; | 1644 | void md5_hash(md5_ctx_t *ctx, const void *data, size_t length) FAST_FUNC; |
1641 | void md5_end(md5_ctx_t *ctx, void *resbuf) FAST_FUNC; | 1645 | void md5_end(md5_ctx_t *ctx, void *resbuf) FAST_FUNC; |
@@ -1648,6 +1652,9 @@ void sha256_begin(sha256_ctx_t *ctx) FAST_FUNC; | |||
1648 | void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; | 1652 | void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC; |
1649 | void sha512_hash(sha512_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; | 1653 | void sha512_hash(sha512_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; |
1650 | void sha512_end(sha512_ctx_t *ctx, void *resbuf) FAST_FUNC; | 1654 | void sha512_end(sha512_ctx_t *ctx, void *resbuf) FAST_FUNC; |
1655 | void sha3_begin(sha3_ctx_t *ctx) FAST_FUNC; | ||
1656 | void sha3_hash(sha3_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC; | ||
1657 | void sha3_end(sha3_ctx_t *ctx, uint8_t *resbuf) FAST_FUNC; | ||
1651 | 1658 | ||
1652 | extern uint32_t *global_crc32_table; | 1659 | extern uint32_t *global_crc32_table; |
1653 | uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC; | 1660 | uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC; |
diff --git a/include/platform.h b/include/platform.h index 4025561c6..128230658 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -205,6 +205,7 @@ | |||
205 | 205 | ||
206 | #include <stdint.h> | 206 | #include <stdint.h> |
207 | typedef int bb__aliased_int FIX_ALIASING; | 207 | typedef int bb__aliased_int FIX_ALIASING; |
208 | typedef long bb__aliased_long FIX_ALIASING; | ||
208 | typedef uint16_t bb__aliased_uint16_t FIX_ALIASING; | 209 | typedef uint16_t bb__aliased_uint16_t FIX_ALIASING; |
209 | typedef uint32_t bb__aliased_uint32_t FIX_ALIASING; | 210 | typedef uint32_t bb__aliased_uint32_t FIX_ALIASING; |
210 | 211 | ||
@@ -212,7 +213,8 @@ typedef uint32_t bb__aliased_uint32_t FIX_ALIASING; | |||
212 | * a lvalue. This makes it more likely to not swap them by mistake | 213 | * a lvalue. This makes it more likely to not swap them by mistake |
213 | */ | 214 | */ |
214 | #if defined(i386) || defined(__x86_64__) || defined(__powerpc__) | 215 | #if defined(i386) || defined(__x86_64__) || defined(__powerpc__) |
215 | # define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp)) | 216 | # define move_from_unaligned_int(v, intp) ((v) = *(bb__aliased_int*)(intp)) |
217 | # define move_from_unaligned_long(v, longp) ((v) = *(bb__aliased_long*)(longp)) | ||
216 | # define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p)) | 218 | # define move_from_unaligned16(v, u16p) ((v) = *(bb__aliased_uint16_t*)(u16p)) |
217 | # define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p)) | 219 | # define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p)) |
218 | # define move_to_unaligned16(u16p, v) (*(bb__aliased_uint16_t*)(u16p) = (v)) | 220 | # define move_to_unaligned16(u16p, v) (*(bb__aliased_uint16_t*)(u16p) = (v)) |
@@ -221,6 +223,7 @@ typedef uint32_t bb__aliased_uint32_t FIX_ALIASING; | |||
221 | #else | 223 | #else |
222 | /* performs reasonably well (gcc usually inlines memcpy here) */ | 224 | /* performs reasonably well (gcc usually inlines memcpy here) */ |
223 | # define move_from_unaligned_int(v, intp) (memcpy(&(v), (intp), sizeof(int))) | 225 | # define move_from_unaligned_int(v, intp) (memcpy(&(v), (intp), sizeof(int))) |
226 | # define move_from_unaligned_long(v, longp) (memcpy(&(v), (longp), sizeof(long))) | ||
224 | # define move_from_unaligned16(v, u16p) (memcpy(&(v), (u16p), 2)) | 227 | # define move_from_unaligned16(v, u16p) (memcpy(&(v), (u16p), 2)) |
225 | # define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4)) | 228 | # define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4)) |
226 | # define move_to_unaligned16(u16p, v) do { \ | 229 | # define move_to_unaligned16(u16p, v) do { \ |