[PATCH] D121531: [ELF] Implement --build-id={md5, sha1} with truncated BLAKE3

Joerg Sonnenberger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 12 16:18:19 PST 2022


joerg added a comment.

I would find it quite surprising to find two binaries produced with the same command line now resulting in different build-ids, if that is the only difference. Especially when the cryptographic hash function is explicitly set.

For reference, I did some tests a while ago in the context of Mercurial's SHA1 replacement and got the following numbers on a Threadripper using a large file:

| BLAKE2s256 | asm | 13.8s |
| SHA2-256   | asm | 4.5s  |
| SHA2-256   | C   | 28.0s |
| SHA3-256   | asm | 16.7s |
| SHA3-256   | C   | 19.8s |
| K12          | asm | 5.9s  |
| K12          | C   | 9.2s  |
| BLAKE3     | asm | 4.1s  |
| BLAKE3     | C   | 10.1s |
| BLAKE3*    | asm | 5.5s  |
| BLAKE3*    | C   | 13.8s |
|

I've included variants of BLAKE3 with the same number of rounds as BLAKE2 to show that much of the gain is actually from the weaker security. There are arguments speaking for K12, especially that we are likely to see some form of hardware support in the future given that it is using the sponge function of SHA3.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121531/new/

https://reviews.llvm.org/D121531



More information about the llvm-commits mailing list