diff options
author | dimitri staessens <[email protected]> | 2017-04-16 09:40:32 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2017-04-16 09:40:32 +0200 |
commit | ffc4468030398955ec56dac17934b43adfeab68b (patch) | |
tree | 5586e971b0924d6a888cbe11ff09f68bcba12edb /src/lib/sha3.c | |
parent | e543c43c9f911bbe40371e3c6ca5c916cb3365a9 (diff) | |
download | ouroboros-ffc4468030398955ec56dac17934b43adfeab68b.tar.gz ouroboros-ffc4468030398955ec56dac17934b43adfeab68b.zip |
lib: Fix minor things in sha3 implementation
Diffstat (limited to 'src/lib/sha3.c')
-rw-r--r-- | src/lib/sha3.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/sha3.c b/src/lib/sha3.c index f80cc4bd..2c8a4614 100644 --- a/src/lib/sha3.c +++ b/src/lib/sha3.c @@ -268,7 +268,9 @@ void rhash_sha3_update(struct sha3_ctx * ctx, size_t block_size = (size_t) ctx->block_size; uint8_t * msg = (uint8_t *) pmsg; - if (ctx->rest & SHA3_FINALIZED) return; + if (ctx->rest & SHA3_FINALIZED) + return; + ctx->rest = (unsigned) ((ctx->rest + size) % block_size); /* fill partial block */ |