Replace MD5 with xxhash
py0xc3 opened this issue · 2 comments
DNF still uses MD5 for error correction after downloading. I suggest to replace MD5 with xxhash or another comparable algorithm. This will improve the performance. Given that there is a OpenPGP-based cryptographic authentication/verification later anyway, it will be sufficient to stick with xxhash 64 for error correction. However, even with gpgcheck=0 I expect xxhash 64 sufficient for error correction.
On 64 bit architectures, xxhash 64 already increases the performance in a noteworthy manner in BTRFS's checksumming compared to CRC32C (which is itself generally faster than MD5), where xxhash 64 was standardized along with three other algorithms. xxhash is specifically designed for modern architectures, unlike CRC32 or MD5. As MD5 used to have a cryptographic purpose (which it no longer fulfills anyway), it is unlikely that it will have a performance advantage against xxhash on any architecture that is in use today.
If it is easier in development to stick with 128 bit length, there is also xxhash 128.
This issue is not critical, but might be considered in future developments.
What exactly do you mean by error correction? Can you be more specific?
Can you point to some code?
Sorry, I just recognized that deltarpm is separated from the dnf repos. Just identified the code there. I will open the ticket in deltarpm's repo. Please excuse the inconvenience.