cryptohash 0.11.2 → 0.11.3
raw patch · 4 files changed
+15/−7 lines, 4 files
Files
- cbits/sha3.c +2/−2
- cbits/skein256.c +6/−2
- cbits/skein512.c +6/−2
- cryptohash.cabal +1/−1
cbits/sha3.c view
@@ -124,8 +124,8 @@ 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 */
cbits/skein256.c view
@@ -124,6 +124,9 @@ { uint32_t to_fill; + if (!len)+ return;+ to_fill = 32 - ctx->bufindex; if (ctx->bufindex == 32) {@@ -131,8 +134,9 @@ ctx->bufindex = 0; } - /* process partial buffer if there's enough data to make a block */- if (ctx->bufindex && len >= to_fill) {+ /* process partial buffer if there's enough data to make a block+ * and there's without doubt further blocks */+ if (ctx->bufindex && len > to_fill) { memcpy(ctx->buf + ctx->bufindex, data, to_fill); skein256_do_chunk(ctx, (uint64_t *) ctx->buf, 32); len -= to_fill;
cbits/skein512.c view
@@ -142,6 +142,9 @@ { uint32_t to_fill; + if (!len)+ return;+ to_fill = 64 - ctx->bufindex; if (ctx->bufindex == 64) {@@ -149,8 +152,9 @@ ctx->bufindex = 0; } - /* process partial buffer if there's enough data to make a block */- if (ctx->bufindex && len >= to_fill) {+ /* process partial buffer if there's enough data to make a block+ * and there's without doubt further blocks */+ if (ctx->bufindex && len > to_fill) { memcpy(ctx->buf + ctx->bufindex, data, to_fill); skein512_do_chunk(ctx, (uint64_t *) ctx->buf, 64); len -= to_fill;
cryptohash.cabal view
@@ -1,5 +1,5 @@ Name: cryptohash-Version: 0.11.2+Version: 0.11.3 Description: A collection of crypto hashes, with a practical incremental and one-pass, pure APIs, with performance close to the fastest implementations available in other languages.