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:
authorcr-marcstevens <github@marc-stevens.nl>2017-03-13 23:06:49 +0300
committercr-marcstevens <github@marc-stevens.nl>2017-03-13 23:06:49 +0300
commit6e60421533749586a0336976e471d9c91f6fd8a3 (patch)
tree2bd13393129fa2dc936af7f107173ebe00ae1274
parentb17728507ae4c8c13ff4eb521f3d24b493fbe150 (diff)
Small bug fix for new code when UBC is disabled
-rw-r--r--lib/sha1.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/sha1.c b/lib/sha1.c
index 745d7f5..fa552af 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -985,8 +985,9 @@ sha1_recompression_type sha1_recompression_step[80] =
void sha1_process(SHA1_CTX* ctx, const uint32_t block[16])
{
unsigned i, j;
- uint32_t ubc_dv_mask[DVMASKSIZE] = { 0 };
+ uint32_t ubc_dv_mask[DVMASKSIZE] = { 0xFFFFFFFF };
uint32_t ihvtmp[5];
+
/*
for (i=0; i < DVMASKSIZE; ++i)
ubc_dv_mask[i]=0;
@@ -1001,15 +1002,12 @@ void sha1_process(SHA1_CTX* ctx, const uint32_t block[16])
if (ctx->detect_coll)
{
- int perform_full_check = 1;
-
if (ctx->ubc_check)
{
ubc_check(ctx->m1, ubc_dv_mask);
- perform_full_check = CHECK_DVMASK(ubc_dv_mask);
}
- if (perform_full_check)
+ if (ubc_dv_mask[0] != 0)
{
for (i = 0; sha1_dvs[i].dvType != 0; ++i)
{