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 <p...@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

Reply via email to