Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

SHA3 doesn't need to get a block for future finalization.

Process as many blocks as possible everywhere.
  • Loading branch information...
commit 830a113f406d1802dcfcb774d3222eb96b1f6792 1 parent 0999082
@vincenthz authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 cbits/sha3.c
View
4 cbits/sha3.c
@@ -124,8 +124,8 @@ void sha3_update(struct sha3_ctx *ctx, uint8_t *data, uint32_t len)
ctx->bufindex = 0;
}
- /* process as much ctx->bufsz-block as possible except the last one in case we finalize */
- for (; len > ctx->bufsz; len -= ctx->bufsz, data += ctx->bufsz)
+ /* process as much ctx->bufsz-block */
+ for (; len >= ctx->bufsz; len -= ctx->bufsz, data += ctx->bufsz)
sha3_do_chunk(ctx->state, (uint64_t *) data, ctx->bufsz / 8);
/* append data into buf */
Please sign in to comment.
Something went wrong with that request. Please try again.