xbps icon indicating copy to clipboard operation
xbps copied to clipboard

Consider switching to BLAKE3 hash function

Open Logarithmus opened this issue 4 years ago • 3 comments

BLAKE3 is an order of magnitude faster than SHA256. ccache & sccache already use it. Updating all template files in void-packages is trivial to automate.

Logarithmus avatar Feb 22 '21 15:02 Logarithmus

Just my .02€:

The time to download a package is certainly several orders of magnitude higher than even the slowest implementation of SHA256. I don't see a practical value in switching to a different algorithm which is used only a couple of times per e.g. system update, and even xbps-pkgdb -a will spend way more time on reading the files from your medium than computing their SHA256 hashes - I presume.

Using BLAKE3 in ccache or rsync makes perfect sense because there literally thousands of hashes need to be calculated and many files are cached in RAM while being processed (through pipes, the file system cache, ...).

pullmoll avatar Feb 22 '21 15:02 pullmoll

There isn't a blake3 standalone library (and I believe we don't want to add more deps to XBPS anyway), which means we'd need to vendor in the whole repository and the build system madness (or stick with only the portable implementation, which is reasonably small but probably not as fast). AFAIK the availability of command line tools isn't great either.

BLAKE3 also had endianness issues until only recently, and sometimes build issues crop up on platforms we support. I don't know how much testing it gets on those platforms, and would be worried about simply deploying it.

And pullmoll also has great points.

ericonr avatar Feb 22 '21 15:02 ericonr

library and cli tool: https://github.com/michaelforney/b3sum

illiliti avatar Dec 03 '21 20:12 illiliti