Skip to content

Instantly share code, notes, and snippets.

@peak-load
Last active October 20, 2023 13:10
Show Gist options
  • Save peak-load/172c4125dcef848dd920d826f2830bd5 to your computer and use it in GitHub Desktop.
Save peak-load/172c4125dcef848dd920d826f2830bd5 to your computer and use it in GitHub Desktop.
sha2-vs-sha3-tests

RHASH

% time rhash --sha256 debian-12.1.0-amd64-netinst.iso
3.57s user 0.15s system 99% cpu 3.756 total
% time rhash --sha3-256 debian-12.1.0-amd64-netinst.iso
2.74s user 0.13s system 99% cpu 2.892 total
% time rhash --sha384 debian-12.1.0-amd64-netinst.iso
2.05s user 0.14s system 99% cpu 2.203 total
% time rhash --sha3-384 debian-12.1.0-amd64-netinst.iso
3.62s user 0.16s system 98% cpu 3.825 total
% time rhash --sha512 debian-12.1.0-amd64-netinst.iso
2.06s user 0.13s system 99% cpu 2.204 total
% time rhash --sha3-512 debian-12.1.0-amd64-netinst.iso
5.08s user 0.14s system 99% cpu 5.246 total

OPENSSL

% time openssl speed -evp sha512
Doing sha512 for 3s on 16 size blocks: 5696162 sha512's in 2.99s
Doing sha512 for 3s on 64 size blocks: 5666498 sha512's in 2.99s
Doing sha512 for 3s on 256 size blocks: 3133596 sha512's in 2.99s
Doing sha512 for 3s on 1024 size blocks: 1342549 sha512's in 2.98s
Doing sha512 for 3s on 8192 size blocks: 214987 sha512's in 2.99s
Doing sha512 for 3s on 16384 size blocks: 109425 sha512's in 2.99s
version: 3.1.2
built on: Tue Aug  1 13:36:55 2023 UTC
options: bn(64,64)
compiler: clang -fPIC -arch x86_64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
CPUINFO: OPENSSL_ia32cap=0x7ffaf3bfffebffff:0x29c6fbf
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
sha512           30481.13k   121289.59k   268294.51k   461332.27k   589021.24k   599605.08k
openssl speed -evp sha512  17.94s user 0.04s system 99% cpu 18.033 total
% time openssl speed -evp sha3-512
Doing sha3-512 for 3s on 16 size blocks: 3759253 sha3-512's in 2.97s
Doing sha3-512 for 3s on 64 size blocks: 3850913 sha3-512's in 2.99s
Doing sha3-512 for 3s on 256 size blocks: 1451106 sha3-512's in 2.99s
Doing sha3-512 for 3s on 1024 size blocks: 436452 sha3-512's in 2.98s
Doing sha3-512 for 3s on 8192 size blocks: 60322 sha3-512's in 2.99s
Doing sha3-512 for 3s on 16384 size blocks: 30657 sha3-512's in 2.98s
version: 3.1.2
built on: Tue Aug  1 13:36:55 2023 UTC
options: bn(64,64)
compiler: clang -fPIC -arch x86_64 -O3 -Wall -DL_ENDIAN -DOPENSSL_PIC -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DNDEBUG
CPUINFO: OPENSSL_ia32cap=0x7ffaf3bfffebffff:0x29c6fbf
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
sha3-512         20251.87k    82427.57k   124241.85k   149975.45k   165270.18k   168551.77k
openssl speed -evp sha3-512  17.91s user 0.04s system 99% cpu 18.036 total

Inspired by:

https://bench.cr.yp.to/results-hash.html

https://news.ycombinator.com/item?id=14455282

https://github.com/rhash/RHash.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment