diff options
author | dimitri staessens <dimitri.staessens@ugent.be> | 2017-04-12 16:57:48 +0200 |
---|---|---|
committer | dimitri staessens <dimitri.staessens@ugent.be> | 2017-04-13 11:30:20 +0200 |
commit | fc10a7587b1a642748ae0fd69f08d92b4a902248 (patch) | |
tree | e0b570cf30753a564855242c94d242f597b5c499 /src/lib/sha3.c | |
parent | a3d550ff972121641562d375f75bcf188fc7fe59 (diff) | |
download | ouroboros-fc10a7587b1a642748ae0fd69f08d92b4a902248.tar.gz ouroboros-fc10a7587b1a642748ae0fd69f08d92b4a902248.zip |
lib, ipcpd, irmd: Register hash instead of name
All information passed over the IRMd/IPCP boundary for using IPC
services (flow allocation, registration) is now hashed. This
effectively fixes the shared namespace between DIFs and the IRMDs.
This PR also fixes some API issues (adding const identifiers),
shuffles the include headers a bit and some small bugs.
Diffstat (limited to 'src/lib/sha3.c')
-rw-r--r-- | src/lib/sha3.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/sha3.c b/src/lib/sha3.c index 750038f2..f80cc4bd 100644 --- a/src/lib/sha3.c +++ b/src/lib/sha3.c @@ -44,12 +44,11 @@ */ #include <ouroboros/endian.h> +#include <ouroboros/sha3.h> #include <assert.h> #include <string.h> -#include "sha3.h" - #define IS_ALIGNED_64(p) (0 == (7 & ((const uint8_t *) (p) \ - (const uint8_t *) 0))) #define I64(x) x##LL @@ -262,11 +261,12 @@ static void rhash_sha3_process_block(uint64_t hash[25], #define SHA3_FINALIZED 0x80000000 void rhash_sha3_update(struct sha3_ctx * ctx, - const uint8_t * msg, + const void * pmsg, size_t size) { size_t idx = (size_t) ctx->rest; size_t block_size = (size_t) ctx->block_size; + uint8_t * msg = (uint8_t *) pmsg; if (ctx->rest & SHA3_FINALIZED) return; ctx->rest = (unsigned) ((ctx->rest + size) % block_size); |