git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Hash algorithm choice

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 9, 2009, 18:03 UTC
Message-ID
<7vljls986b.fsf@alter.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.2.01.0908091038300.3288@localhost.localdomain>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 13 quoted lines
> If youlimit the hash size to 20 bytes, there are almost no changes 
> necessary.
>
> You'd need to hijack the 'SHA1_Init/SHA1_Update/SHA1_Final' functions, of 
> course, and you'd likely want to rename them (and eventually a lot of 
> other functions too), but that renaming is mechanical and isn't even 
> needed for proper working.
>
> Now, if you would ever want to extend the _size_ of the hash, that's a 
> much much bigger problem, but if you're ok with just changing the hash and 
> then truncating the result to 20 bytes (ie kind of like sha-512-160), or 
> you're ok with limiting yourself to 20-byte hashes like REIPMD-160, the 
> size of the changes should be minimal.

Just in case Jerome really wants to go further, "almost no changes" and "minimal" refers to the fact that we have a few hard-coded hash values known to the code, such as the object name for an empty blob and an empty tree.

Previous: Linus TorvaldsNext: Sverre Rabbelier
Message 3 of 8 in “Hash algorithm choice”
  1. Jerome BaumAug 9, 2009
  2. Linus TorvaldsAug 9, 2009
  3. Junio C HamanoAug 9, 2009
  4. Sverre RabbelierAug 9, 2009
  5. Linus TorvaldsAug 9, 2009
  6. Linus TorvaldsAug 9, 2009
  7. Johannes SchindelinAug 9, 2009
  8. Matthieu MoyAug 9, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.