Comment

Comment by bascule

Yes, exactly.

If Linus truly doesn't care about security, then git could use any error correcting code that produces a uniform distribution of tags, such as CRC64. The size of the tag only affects the number of objects we'd expect to be able to commit before we see a collision: over 4 billion in the case of CRC64.

Linux mistakenly claims using a cryptographic hash function helps avoid non-malicious collisions, but this is not the case.

Where the choice of a cryptographic hash function matters is specifically if we expect an attacker to be trying to collide tags. CRC64 is a linear function of the input data and therefore fails miserably at preventing attackers from colliding tags, but still produces a uniform distribution of tags for non-malicious inputs.

git seems to be in the odd place where Linus argues he's using a cryptographic hash function but not for security purposes.

parent bascule 9 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton