On 08/02/19 07:12, Matteo Croce wrote:
> Hi,
> 
> latest gnulib have support for sendfile and AF_ALG, the kernel crypto
> framework, if compiled with --with-linux-crypto.
> This allows to have very fast hashing algorythms but without the
> libcrypto dependency,
> 
> coreutils$ ./configure --with-linux-crypto
> [...]
> checking whether linux/if_alg.h has struct sockaddr_alg.... yes
> [...]
> 
> coreutils$ ldd src/sha1sum /usr/bin/sha1sum
> src/sha1sum:
>         linux-vdso.so.1 (0x00007fff1d56b000)
>         libc.so.6 => /lib64/libc.so.6 (0x00007f156b70c000)
>         /lib64/ld-linux-x86-64.so.2 (0x00007f156b902000)
> /usr/bin/sha1sum:
>         linux-vdso.so.1 (0x00007ffebef02000)
>         libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007fe977d09000)
>         libc.so.6 => /lib64/libc.so.6 (0x00007fe977b43000)
>         libz.so.1 => /lib64/libz.so.1 (0x00007fe977b29000)
>         libdl.so.2 => /lib64/libdl.so.2 (0x00007fe977b23000)
>         libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fe977b01000)
>         /lib64/ld-linux-x86-64.so.2 (0x00007fe978020000)
> 
> coreutils$ time /usr/bin/sha1sum zero
> 2a492f15396a6768bcbca016993f4b4c8b0b5307  zero
> 
> real    0m1,254s
> user    0m1,147s
> sys     0m0,108s
> coreutils$ truncate -s1g zero
> coreutils$ time src/sha1sum zero
> 2a492f15396a6768bcbca016993f4b4c8b0b5307  zero
> 
> real    0m1,234s
> user    0m0,005s
> sys     0m1,230s
> 
> Think about enabling it.

Depending on which kernel is used this can also be significantly slower.
Enabling this by default should be very carefully considered as
per the reasons detailed at:
https://lists.gnu.org/archive/html/coreutils/2018-06/msg00034.html

BTW openssl 3 is relicensed, so debian should be in a position
to enable use of libcrypto routines then.

cheers,
Pádraig

Reply via email to