Git development
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Jerome Baum <jerome@jeromebaum.com>
Cc: git@vger.kernel.org
Subject: Re: Hash algorithm choice
Date: Sun, 9 Aug 2009 10:46:25 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0908091038300.3288@localhost.localdomain> (raw)
In-Reply-To: <f448a46a0908090917s102b4c83pbad6f298a8e127cc@mail.gmail.com>



On Sun, 9 Aug 2009, Jerome Baum wrote:
> 
> How difficult would it be to allow users to choose a hash function
> during git-init which is then globally used in the repo? Are there
> many changes needed or are changes in git-hash-object and git-init
> sufficient?

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.

			Linus

  reply	other threads:[~2009-08-09 17:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f448a46a0908090907v68542e4dw1f1c4f610cb46ca2@mail.gmail.com>
2009-08-09 16:17 ` Hash algorithm choice Jerome Baum
2009-08-09 17:46   ` Linus Torvalds [this message]
2009-08-09 18:03     ` Junio C Hamano
2009-08-09 18:16       ` Sverre Rabbelier
2009-08-09 18:35         ` Linus Torvalds
2009-08-09 18:33       ` Linus Torvalds
2009-08-09 17:49   ` Johannes Schindelin
2009-08-09 18:44   ` Matthieu Moy

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=alpine.LFD.2.01.0908091038300.3288@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=git@vger.kernel.org \
    --cc=jerome@jeromebaum.com \
    /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