Open lukateras opened 6 years ago
I would like to send a patch if this is approved (no new dependencies).
Well, we already have SHA-512, which is much faster than SHA-256 (at least in the current implementation).
BLAKE2b is about 1.5x faster than SHA-512 (similar to margin between SHA-256 and SHA-512), while also being way simpler (compare https://github.com/openssl/openssl/blob/master/crypto/sha/sha512.c at 694 SLOC with https://github.com/openssl/openssl/blob/master/crypto/blake2/blake2b.c at 241 SLOC). See https://blake2.net/.
It was also introduced in coreutils, see b2sum(1)
and http://lists.gnu.org/archive/html/coreutils/2015-05/msg00048.html.
(For anyone who wants to study the function, here's cleaned up source code: https://github.com/yegortimoshenko/sylpheed/blob/d7a91f82e5785992e3716529b63d8530560a5479/src/blake2b.c)
Another promising candidate is BLAKE3 (which appeared recently in Jan 2020). It is 6x faster than sha512 on my machine on some random 91M file from /nix/store
.
Probably duplicate of #1133.
Gentoo uses blake2b since end of 2017. (source: wiki page on manifest files and mailing list annoucement)
Archlinux has blake2 support. (source: arch wiki PKGBUILD and b2sums in PKGBUILD(5))
I marked this as stale due to inactivity. → More info
blake3 seems like a good candidate
I marked this as stale due to inactivity. → More info
SHA256 is rather slow at checksumming large files (tangentially related to #619), would be nice to have something that is both fast and future-proof.
Use case would be to
nix-hash
large (> 4GB) files to check if already present in Nix store. This takes a while with SHA256, and would probably take at least 2x less time with BLAKE2b.