Skip to content

Commit c0c2006

Browse files
peffgitster
authored andcommitted
sha1dc: disable safe_hash feature
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 45a574e commit c0c2006

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sha1dc/sha1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ void SHA1DCInit(SHA1_CTX* ctx)
16611661
ctx->ihv[3] = 0x10325476;
16621662
ctx->ihv[4] = 0xC3D2E1F0;
16631663
ctx->found_collision = 0;
1664-
ctx->safe_hash = 1;
1664+
ctx->safe_hash = 0;
16651665
ctx->ubc_check = 1;
16661666
ctx->detect_coll = 1;
16671667
ctx->reduced_round_coll = 0;

0 commit comments

Comments
 (0)