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

Mozilla SHA1 implementation

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 21, 2005, 19:48 UTC
Message-ID
<Pine.LNX.4.58.0504211238150.2344@ppc970.osdl.org>
In-Reply-To
<20050418055824.42d621b8.froese@gmx.de>

I've just integrated the Mozilla SHA1 library implementation that Adgar Toernig sent me into the standard git archive (but I did the integration differently).

The Mozilla SHA1 code is copyright Paul Kocher and Cryptography Research, and is released under a dual MPL/GPL license. Git obviously uses it in the GPL version, but I left the MPL choice there too, so that those two files (that are in a subdirectory of its own) will continue to be dual-licensed.

NOTE! I left git using the openssl libraries by default, and this is a built-time choice in the makefile. You can choose the Mozilla SHA1 implementation by doing

	make clean
	MOZILLA_SHA1=1 make
	make install

but I suspect that anybody that has openssl installed and is working on an x86 is much better off with the i586-optimized openssl version. But if you don't have openssl by default, or if you don't like openssl for some other reason, you now have a nice easy choice.

Interestingly, the Mozilla SHA1 code is about twice as fast as the openssl code on my G5, and judging by the disassembly, it's because it's much simpler. I think the openssl people have unrolled all the loops totally, which tends to be a disaster on any half-way modern CPU. But hey, it could be something as simple as optimization flags too.

			Linus
Previous: Edgar ToernigNext: Edgar Toernig
Message 5 of 13 in “use gcrypt instead of libssl for hash”
  1. use gcrypt instead of libssl for hashJunichi Uekawa, Apr 17, 2005
  2. Linus TorvaldsApr 17, 2005
  3. Junichi UekawaApr 17, 2005
  4. Edgar ToernigApr 18, 2005
  5. Mozilla SHA1 implementationLinus Torvalds, Apr 21, 2005
  6. Edgar ToernigApr 21, 2005
  7. Paul MackerrasApr 22, 2005
  8. Paul MackerrasApr 22, 2005
  9. Linus TorvaldsApr 22, 2005
  10. Linus TorvaldsApr 22, 2005
  11. (anal) Q: Are there any coding styles or development guidelines?Klaus Robert Suetterlin, Apr 22, 2005
  12. Linus TorvaldsApr 22, 2005
  13. Daniel BarkalowApr 22, 2005

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.