Re: dpkg MD5
On Thu, Nov 7, 2024 at 10:12 PM Jeremy Stanley <fungi@yuggoth.org> wrote:
> [...]
>
> Probably the most convincing reason to replace such uses of MD5 is
> that we collectively get to stop wasting time answering this same
> question over and over and over...
One more datapoint that might be useful.... AMD/Intel, ARMv8 and
PowerPC offer SHA-256 acceleration, so SHA-256 outperforms MD5
calculations.
An Ice Lake machine:
CRC-32C: 0.73 cpb
MD5 - 5.5 cpb
SHA256 - 2.6 cpb
A Raptor Lake machine:
CRC-32C - 0.12 cpb
MD5 - 1.6 cpb
SHA256 - 0.6 cpb
An armv8+crypto machine (gcc117 from the Compile Farm)
CRC-32C - 0.76 cpb
MD5 - 6.3 cpb
SHA256 - 2.7 cpb
A POWER8 machine (gcc112 from the Compile Farm)
CRC-32C - 8.2 cpb
MD5 - 11.3 cpb
SHA256 - 3.7 cpb
In the mini table cpb is cycles-per-byte. The smaller the cpb the
better. cpb takes processor speed out of the equation so you can
compare algorithms across architectures.
So if Debian is building lots of *.md5sum files, it might be useful to
consider SHA-256. The calculations will be faster and use less energy.
And if cryptographic properties are not needed, then switch to
CRC-32C, which also has hardware acceleration and is even faster!
Jeff
Reply to: