Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cr-marcstevens/sha1collisiondetection.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2017-05-19 00:48:41 +0300
committerMarc Stevens <cr-marcstevens@users.noreply.github.com>2017-05-20 13:49:39 +0300
commitcc465543b310e5f59a1d534381690052e8509b22 (patch)
tree3ff66534f693c9873a2f8fe05ab6ff3ebd1bff7b
parent56e9ea30d42c09042b852c7f2c149a3e43ab8bc1 (diff)
Skip temporary variable for SHA1DC_ALLOW_UNALIGNED_ACCESS
This is the feedback I left on pull request #30[1] turned into a patch. 1. https://github.com/cr-marcstevens/sha1collisiondetection/pull/30
-rw-r--r--lib/sha1.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/sha1.c b/lib/sha1.c
index 587158c..3dff80a 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -1748,7 +1748,6 @@ void SHA1DCSetCallback(SHA1_CTX* ctx, collision_block_callback callback)
void SHA1DCUpdate(SHA1_CTX* ctx, const char* buf, size_t len)
{
unsigned left, fill;
- const uint32_t* buffer_to_hash = NULL;
if (len == 0)
return;
@@ -1770,12 +1769,11 @@ void SHA1DCUpdate(SHA1_CTX* ctx, const char* buf, size_t len)
ctx->total += 64;
#if defined(SHA1DC_ALLOW_UNALIGNED_ACCESS)
- buffer_to_hash = (const uint32_t*)buf;
+ sha1_process(ctx, (uint32_t*)(buf));
#else
- buffer_to_hash = (const uint32_t*)ctx->buffer;
memcpy(ctx->buffer, buf, 64);
+ sha1_process(ctx, (uint32_t*)(ctx->buffer));
#endif /* defined(SHA1DC_ALLOW_UNALIGNED_ACCESS) */
- sha1_process(ctx, buffer_to_hash);
buf += 64;
len -= 64;
}