From: Petr Baudis <pasky@ucw.cz>
To: linux-kernel@vger.kernel.org
Subject: Re: Call to atention about using hash functions as content indexers (SCM saga)
Date: Tue, 12 Apr 2005 00:51:39 +0200 [thread overview]
Message-ID: <20050411225139.GA9145@pasky.ji.cz> (raw)
In-Reply-To: <20050411224021.GA25106@larroy.com>
Dear diary, on Tue, Apr 12, 2005 at 12:40:21AM CEST, I got a letter
where Pedro Larroy <piotr@larroy.com> told me that...
> Hi
Hello,
> I had a quick look at the source of GIT tonight, I'd like to warn you
> about the use of hash functions as content indexers.
>
> As probably you are aware, hash functions such as SHA-1 are surjective not
> bijective (1-to-1 map), so they have collisions. Here one can argue
> about the low probability of such a collision, I won't get into
> subjetive valorations of what probability of collision is tolerable for
> me and what is not.
>
> I my humble opinion, choosing deliberately, as a design decision, a
> method such as this one, that in some cases could corrupt data in a
> silent and very hard to detect way, is not very good. One can also argue
> that the probability of data getting corrupted in the disk, or whatever
> could be higher than that of the collision, again this is not valid
> comparison, since the fact that indexing by hash functions without
> additional checking could make data corruption legal between the
> reasonable working parameters of the program is very dangerous.
(i) 1461501637330902918203684832716283019655932542976 possible SHA1 hashes.
(ii) In git-pasky, there's (turnable off) detection of collisions.
(iii) Your argument against comparing with the probability of a hardware
error does not make sense to me.
(iv) You fail to propose a better solution.
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
98% of the time I am right. Why worry about the other 3%.
next prev parent reply other threads:[~2005-04-11 22:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-11 22:40 Pedro Larroy
2005-04-11 22:51 ` Petr Baudis [this message]
2005-04-11 23:23 ` Magnus Damm
2005-04-12 10:02 ` Catalin Marinas
2005-04-12 9:59 ` Barry K. Nathan
2005-04-12 12:10 ` Richard B. Johnson
2005-04-12 15:29 ` Theodore Ts'o
2005-04-14 15:54 ` Eric D. Mudama
2005-04-12 16:35 ` Eric Rannaud
2005-04-14 8:30 ` Andy Isaacson
2005-04-14 13:35 ` Eric Rannaud
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=20050411225139.GA9145@pasky.ji.cz \
--to=pasky@ucw.cz \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®