Please provide support for hmac-sha1
On my 4th gen i7 (Haswell) CPU, sha1 is more than twice as fast as sha256:
# openssl speed -evp sha1
Doing sha1 for 3s on 16 size blocks: 20005598 sha1's in 3.00s
Doing sha1 for 3s on 64 size blocks: 13768886 sha1's in 2.99s
Doing sha1 for 3s on 256 size blocks: 7890281 sha1's in 3.00s
Doing sha1 for 3s on 1024 size blocks: 2995214 sha1's in 3.00s
Doing sha1 for 3s on 8192 size blocks: 437417 sha1's in 3.00s
Doing sha1 for 3s on 16384 size blocks: 222403 sha1's in 2.99s
OpenSSL 1.1.0h 27 Mar 2018
built on: reproducible build, date unspecified
options:bn(64,64) rc4(16x,int) des(int) aes(partial) idea(int) blowfish(ptr)
compiler: gcc -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPADLOCK_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
sha1 106696.52k 294718.63k 673303.98k 1022366.38k 1194440.02k 1218679.18k
# openssl speed -evp sha256
Doing sha256 for 3s on 16 size blocks: 13499931 sha256's in 2.99s
Doing sha256 for 3s on 64 size blocks: 8507081 sha256's in 2.99s
Doing sha256 for 3s on 256 size blocks: 4334344 sha256's in 3.00s
Doing sha256 for 3s on 1024 size blocks: 1461393 sha256's in 2.99s
Doing sha256 for 3s on 8192 size blocks: 202994 sha256's in 2.99s
Doing sha256 for 3s on 16384 size blocks: 102512 sha256's in 2.99s
OpenSSL 1.1.0h 27 Mar 2018
built on: reproducible build, date unspecified
options:bn(64,64) rc4(16x,int) des(int) aes(partial) idea(int) blowfish(ptr)
compiler: gcc -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPADLOCK_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/etc/ssl\"" -DENGINESDIR="\"/usr/lib/engines-1.1\"" -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
The 'numbers' are in 1000s of bytes per second processed.
type 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
sha256 72240.43k 182091.37k 369864.02k 500490.45k 556162.83k 561724.62k
at the same time, HMAC-SHA1 provides 160bit level of security, well within the current acceptable level of 128 bit.
this is based on using
# cryptsetup luksFormat --type luks2 --integrity hmac-sha1 --sector-size 4096 /dev/stacja/integr-1
WARNING!
========
This will overwrite data on /dev/stacja/integr-1 irrevocably.
Are you sure? (Type uppercase yes): YES
No known integrity specification pattern detected.
with cryptsetup 2.0.2-1