Coreutils comes with the binary b2sum which can be used as a faster (and more secure) replacement of sha1sum/sha256sum utilities. The coreutils package uses the reference BLAKE2 implementations from the official repository. These reference implementation, while being portable, are not as fast the optimised implementations available from the same repository. My patch uses the
sse versions which are "optimized for speed on CPUs supporting SSE2, SSSE3, SSE4.1, AVX, or XOP".
On an Intel Core i5 (4th Gen, 2 cores) machine running macOS, the b2sum binary built with this patch was about 20% faster than the default coreutils binary.
Patching and building
- Download the latest coreutils tarball. This patch was successfully tested on version 8.31.
- Apply the patch
patch -p1 < ../coreutils-blake2-sse.patch.
- build using the standard instructions. (./configure && make)