sha1dc: disable safe_hash feature
authorJeff King <peff@peff.net>
Thu, 16 Mar 2017 22:08:49 +0000 (18:08 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Mar 2017 22:16:45 +0000 (15:16 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1dc/sha1.c
index d25d93abd889c64cb2f05df2795edeaf63b99409..8ff2321dfb089985b28dddf84513d76f58865ded 100644 (file)
@@ -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;