All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: [PATCH 3/5] sha1dc: disable safe_hash feature
Date: Thu, 16 Mar 2017 18:08:49 -0400	[thread overview]
Message-ID: <20170316220849.ye56ycpoly2o5fg6@sigill.intra.peff.net> (raw)
In-Reply-To: <20170316220456.m4yz2kbvzv6waokn@sigill.intra.peff.net>

The safe_hash feature is designed to make sha1dc a drop-in
replacement for sha1, where colliding entries will get a
permuted hash to un-collide them. However, since we're
handling the collision case ourselves, this isn't helpful
(and is actually harmful, as it means you get the wrong
object id if you want to show it in a log message).

Signed-off-by: Jeff King <peff@peff.net>
---
We could also disable this at runtime, but there's not really any point.
And this way we know that we won't miss a call.

 sha1dc/sha1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sha1dc/sha1.c b/sha1dc/sha1.c
index da516c14c..00760c352 100644
--- a/sha1dc/sha1.c
+++ b/sha1dc/sha1.c
@@ -1661,7 +1661,7 @@ void SHA1DCInit(SHA1_CTX* ctx)
 	ctx->ihv[3] = 0x10325476;
 	ctx->ihv[4] = 0xC3D2E1F0;
 	ctx->found_collision = 0;
-	ctx->safe_hash = 1;
+	ctx->safe_hash = 0;
 	ctx->ubc_check = 1;
 	ctx->detect_coll = 1;
 	ctx->reduced_round_coll = 0;
-- 
2.12.0.623.g86ec6c963


  parent reply	other threads:[~2017-03-16 22:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 20:24 [PATCH 0/2] Re-integrate sha1dc Linus Torvalds
2017-03-16 22:04 ` Jeff King
2017-03-16 22:08   ` [PATCH 2/5] sha1dc: adjust header includes for git Jeff King
2017-03-16 22:08   ` Jeff King [this message]
2017-03-16 22:09   ` [PATCH 4/5] Makefile: add USE_SHA1DC knob Jeff King
2017-03-16 22:43     ` Junio C Hamano
2017-03-17  0:11       ` Jeff King
2017-03-17  5:24         ` Junio C Hamano
2017-03-17 11:18           ` Jeff King
2017-03-17 17:09             ` [RFC PATCH 0/3] Git integration update for DC-SHA1 Junio C Hamano
2017-03-17 17:09               ` [PATCH 1/3] Makefile: add DC_SHA1 knob Junio C Hamano
2017-03-17 17:09               ` [PATCH 3/3] Makefile: make DC_SHA1 the default Junio C Hamano
2017-03-17 17:41               ` [RFC PATCH 0/3] Git integration update for DC-SHA1 Junio C Hamano
2017-03-17 17:45               ` Jeff King
2017-03-16 22:10   ` [PATCH 0/2] Re-integrate sha1dc Jeff King
2017-03-16 22:23     ` Junio C Hamano
2017-03-17  0:14       ` Jeff King
2017-03-17  5:22         ` Junio C Hamano
2017-03-17 11:22           ` Jeff King
2017-03-16 22:30   ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170316220849.ye56ycpoly2o5fg6@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.