Bug#895857: coreutils: sha1sum and other hashing tools are compiled without libcrypto support

2019-02-09 Thread Pádraig Brady
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 (0x7fff1d56b000)
> libc.so.6 => /lib64/libc.so.6 (0x7f156b70c000)
> /lib64/ld-linux-x86-64.so.2 (0x7f156b902000)
> /usr/bin/sha1sum:
> linux-vdso.so.1 (0x7ffebef02000)
> libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x7fe977d09000)
> libc.so.6 => /lib64/libc.so.6 (0x7fe977b43000)
> libz.so.1 => /lib64/libz.so.1 (0x7fe977b29000)
> libdl.so.2 => /lib64/libdl.so.2 (0x7fe977b23000)
> libpthread.so.0 => /lib64/libpthread.so.0 (0x7fe977b01000)
> /lib64/ld-linux-x86-64.so.2 (0x7fe97802)
> 
> coreutils$ time /usr/bin/sha1sum zero
> 2a492f15396a6768bcbca016993f4b4c8b0b5307  zero
> 
> real0m1,254s
> user0m1,147s
> sys 0m0,108s
> coreutils$ truncate -s1g zero
> coreutils$ time src/sha1sum zero
> 2a492f15396a6768bcbca016993f4b4c8b0b5307  zero
> 
> real0m1,234s
> user0m0,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



Bug#895857: coreutils: sha1sum and other hashing tools are compiled without libcrypto support

2019-02-08 Thread Matteo Croce
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 (0x7fff1d56b000)
libc.so.6 => /lib64/libc.so.6 (0x7f156b70c000)
/lib64/ld-linux-x86-64.so.2 (0x7f156b902000)
/usr/bin/sha1sum:
linux-vdso.so.1 (0x7ffebef02000)
libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x7fe977d09000)
libc.so.6 => /lib64/libc.so.6 (0x7fe977b43000)
libz.so.1 => /lib64/libz.so.1 (0x7fe977b29000)
libdl.so.2 => /lib64/libdl.so.2 (0x7fe977b23000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x7fe977b01000)
/lib64/ld-linux-x86-64.so.2 (0x7fe97802)

coreutils$ time /usr/bin/sha1sum zero
2a492f15396a6768bcbca016993f4b4c8b0b5307  zero

real0m1,254s
user0m1,147s
sys 0m0,108s
coreutils$ truncate -s1g zero
coreutils$ time src/sha1sum zero
2a492f15396a6768bcbca016993f4b4c8b0b5307  zero

real0m1,234s
user0m0,005s
sys 0m1,230s

Think about enabling it.

Regards,
-- 
Matteo Croce
per aspera ad upstream



Bug#895857: coreutils: sha1sum and other hashing tools are compiled without libcrypto support

2018-04-16 Thread Matteo Croce
Package: coreutils
Version: 8.26-3
Severity: normal

Dear Maintainer,

the sha{1,224,256,384,512}sum tools included in the coreutils package
can be compiled with libcrypto support. At the expense of a runtime dependency,
the speed gain of the hash calculation is quite noticeable under amd64:

matteo@saturno:~$ dd status=none if=/dev/zero bs=1G count=10 |time -p sha1sum
a0b6e2ca4e28360a929943e8eb966f703a69dc44  -
real 29.27
user 25.71
sys 1.68
matteo@saturno:~$ dd status=none if=/dev/zero bs=1G count=10 |time -p ./sha1sum
a0b6e2ca4e28360a929943e8eb966f703a69dc44  -
real 20.91
user 17.35
sys 1.67

while it's huge on aarch64:

matteo@macchiatobin:~$ dd status=none if=/dev/zero bs=1G count=10 |time -p 
sha1sum
a0b6e2ca4e28360a929943e8eb966f703a69dc44  -
real 49.37
user 44.34
sys 3.11
matteo@macchiatobin:~$ dd status=none if=/dev/zero bs=1G count=10 |time -p 
./sha1sum
a0b6e2ca4e28360a929943e8eb966f703a69dc44  -
real 15.53
user 9.88
sys 3.37

ldd output between Debian binary and the test one (grabbed from a Fedora 27 RPM)

matteo@saturno:~$ ldd /usr/bin/sha1sum
linux-vdso.so.1 (0x7fff4a5be000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7f01debf3000)
/lib64/ld-linux-x86-64.so.2 (0x7f01df19e000)
matteo@saturno:~$ ldd ./sha1sum
linux-vdso.so.1 (0x7fffcabc7000)
libcrypto.so.1.1 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 
(0x7fb4a7086000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x7fb4a6ce7000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x7fb4a6ae3000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x7fb4a68c6000)
/lib64/ld-linux-x86-64.so.2 (0x7fb4a7724000)


-- System Information:
Debian Release: 9.4
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.16.0-saturno (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages coreutils depends on:
ii  libacl1  2.2.52-3+b1
ii  libattr1 1:2.4.47-2+b2
ii  libc62.24-11+deb9u3
ii  libselinux1  2.6-3+b3

coreutils recommends no packages.

coreutils suggests no packages.

-- no debconf information