Re: Hash algorithm choice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]