This removes some of now duplicated code.
I'm not sure if this should be merged as the patch comes with some performance drawback.
See below for details.
Details
Details
Tested on Intel i5-10500E
Reference:
cryptotest -d ossl -a chacha20 100000 64 128 256 512 1024 1480 65
0.159 sec, 200000 chacha20 crypts, 64 bytes, 80494538 byte/sec, 614.1 Mb/sec 0.168 sec, 200000 chacha20 crypts, 128 bytes, 152291209 byte/sec, 1161.9 Mb/sec 0.182 sec, 200000 chacha20 crypts, 256 bytes, 280840327 byte/sec, 2142.6 Mb/sec 0.184 sec, 200000 chacha20 crypts, 512 bytes, 557312274 byte/sec, 4252.0 Mb/sec 0.224 sec, 200000 chacha20 crypts, 1024 bytes, 912977385 byte/sec, 6965.5 Mb/sec 0.291 sec, 200000 chacha20 crypts, 1480 bytes, 1016899076 byte/sec, 7758.3 Mb/sec 5.718 sec, 200000 chacha20 crypts, 65536 bytes, 2292098057 byte/sec, 17487.3 Mb/sec
This patch:
cryptotest -d ossl -a chacha20 100000 64 128 256 512 1024 1480 65536
0.166 sec, 200000 chacha20 crypts, 64 bytes, 77102396 byte/sec, 588.2 Mb/sec 0.175 sec, 200000 chacha20 crypts, 128 bytes, 145898874 byte/sec, 1113.1 Mb/sec 0.189 sec, 200000 chacha20 crypts, 256 bytes, 270600236 byte/sec, 2064.5 Mb/sec 0.192 sec, 200000 chacha20 crypts, 512 bytes, 532761724 byte/sec, 4064.6 Mb/sec 0.233 sec, 200000 chacha20 crypts, 1024 bytes, 880496655 byte/sec, 6717.7 Mb/sec 0.298 sec, 200000 chacha20 crypts, 1480 bytes, 993952337 byte/sec, 7583.3 Mb/sec 5.707 sec, 200000 chacha20 crypts, 65536 bytes, 2296720473 byte/sec, 17522.6 Mb/sec
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped