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

Re: [PATCH v2] ppc: remove custom SHA-1 implementation

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Mar 21, 2022, 21:19 UTC
Message-ID
<Yjjr9fkybVmB53M7@camp.crustytoothpaste.net>
In-Reply-To
<patch-v2-1.1-e77fd23a824-20220321T170412Z-avarab@gmail.com>
On 2022-03-21 at 17:06:12, Ævar Arnfjörð Bjarmason wrote:
Show 33 quoted lines
> Remove the PPC_SHA1 implementation added in a6ef3518f9a ([PATCH] PPC
> assembly implementation of SHA1, 2005-04-22). When this was added
> Apple consumer hardware used the PPC architecture, and the
> implementation was intended to improve SHA-1 speed there.
> 
> Since it was added we've moved to DC_SHA1 by default, and anyone
> wanting hard-rolled non-DC SHA-1 implementation can use OpenSSL's via
> the OPENSSL_SHA1 knob.
> 
> I'm unsure if this was ever supposed to work on 64-bit PPC. It clearly
> originally targeted 32 bit PPC, but there's some mailing list
> references to this being tried on G5 (PPC 970). I can't get it to do
> anything but segfault on the BE POWER8 machine in the GCC compile
> farm. Anyone caring about speed on PPC these days is likely to be
> using IBM's POWER, not PPC 970.
> 
> There have been proposals to entirely remove non-DC_SHA1
> implementations from the tree[1]. I think per [2] that would be a bit
> overzealous. I.e. there are various set-ups git's speed is going to be
> more important than the relatively implausible SHA-1 collision attack,
> or where such attacks are entirely mitigated by other means (e.g. by
> incoming objects being checked with DC_SHA1).
> 
> The main reason for doing so at this point is to simplify follow-up
> Makefile change. Since PPC_SHA1 included the only in-tree *.S assembly
> file we needed to keep around special support for building objects
> from it. By getting rid of it we know we'll always build *.o from *.c
> files, which makes the build process simpler.
> 
> As an aside the code being removed here was also throwing warnings
> with the "-pedantic" flag, but let's remove it instead of fixing it,
> as 544d93bc3b4 (block-sha1: remove use of obsolete x86 assembly,
> 2022-03-10) did for block-sha1/*.

While I don't agree that we shouldn't remove the other non-DC SHA-1 implementations, I do agree that we should remove this one. Given the testing you've done and the fact that almost everyone desiring speed is using a 64-bit machine these days, I think it's unlikely that anyone is using this in the real world.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 11 of 17 in “SHA1dc on mac”
  1. Mike HommeyFeb 12, 2020
  2. Eric SunshineFeb 12, 2020
  3. Mike HommeyFeb 12, 2020
  4. Junio C HamanoFeb 12, 2020
  5. Remove non-SHA1dc sha1 implementationsMike Hommey, Feb 23, 2020
  6. Jeff KingFeb 24, 2020
  7. Jeff KingFeb 24, 2020
  8. ppc: remove custom SHA-1 implementationÆvar Arnfjörð Bjarmason, Mar 19, 2022
  9. Junio C HamanoMar 21, 2022
  10. ppc: remove custom SHA-1 implementationÆvar Arnfjörð Bjarmason, Mar 21, 2022
  11. brian m. carlsonMar 21, 2022
  12. 0/2 Makefile + hash.h: remove PPC_SHA1 implementationÆvar Arnfjörð Bjarmason, Aug 31, 2022
  13. 2/2 Makefile: use $(OBJECTS) instead of $(C_OBJ)Ævar Arnfjörð Bjarmason, Aug 31, 2022
  14. Junio C HamanoAug 31, 2022
  15. Ævar Arnfjörð BjarmasonSep 1, 2022
  16. Junio C HamanoSep 1, 2022
  17. 1/2 Makefile + hash.h: remove PPC_SHA1 implementationÆvar Arnfjörð Bjarmason, Aug 31, 2022

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.