libbb/sha1: optional x86-64 hardware accelerates hashing

function                                             old     new   delta
sha1_process_block64_shaNI                             -     510    +510
sha1_begin                                            52     107     +55
.rodata                                           108285  108301     +16
static.shaNI                                           -       1      +1
------------------------------------------------------------------------------
(add/remove: 4/0 grow/shrink: 2/0 up/down: 582/0)             Total: 582 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2022-01-07 00:43:59 +01:00
parent a93668cc42
commit 711e20ecb8
4 changed files with 270 additions and 1 deletions

View File

@@ -63,6 +63,13 @@ config SHA1_SMALL
1 224 229 654 732
2,3 200 195 358 380
config SHA1_HWACCEL
bool "SHA1: Use hardware accelerated instructions if possible"
default y
help
On x86, this adds ~590 bytes of code. Throughput
is about twice as fast as fully-unrolled generic code.
config SHA3_SMALL
int "SHA3: Trade bytes for speed (0:fast, 1:slow)"
default 1 # all "fast or small" options default to small