4 ms·
Not the OP, but those extensions implements cryptographic hash functions, they are not very suitable (too slow) for hash-tables and other hash based data struct
by JacobiX 4y ago
Not the OP, but those extensions implements cryptographic hash functions, they are not very suitable (too slow) for hash-tables and other hash based data structures.
- generichuman 4y ago4 CPU cycles is too slow? Because SHA256RNDS2 is 4 clock cycles on Zen3 CPUs. 6 clock cycles on Intel Alder Lake (12th gen). Source is the measurements here: https://uops.info/table.html https://uops.info/table.html
- JacobiX 4y agoYes, because SHA256RNDS2 aid the implementation of the update function of SHA256. We should invoke it multiple times on the message blocks, it performs two rounds out of the 64 SHA256 rounds.
- generichuman 4y ago> We should invoke it multiple times That'd make SHA256RNDS2 even faster because of the throughput numbers. I'm curious, what's the faster algorithm for hashing you use? I don't want to waste time on intrinsics and inflict complexity on my colleagues if there are alternatives I can use!
- JacobiX 4y agoI’ll just use xxHash family, murmur hash family or even FNV. For crypto, BLAKE2 is a cryptographic hash that’s faster than SHA,MD5, etc and is at least as secure as the SHA-3.