]> Savannah Git Hosting - gnulib.git/commitdiff
af_alg: disable kernel hash functions by default
authorPádraig Brady <P@draigBrady.com>
Sun, 24 Jun 2018 09:09:12 +0000 (02:09 -0700)
committerPádraig Brady <P@draigBrady.com>
Sun, 24 Jun 2018 20:54:52 +0000 (13:54 -0700)
All the kernel routines were seen to be significantly slower
with these relatively recent components on an i3-2310M system:
  kernel-4.10.6-200.fc25.x86_64
  openssl-1.0.2m-1.fc25.x86_64
sha1 was nearly twice as slow in the kernel for example,
compared to the libcrypto routines.

Further considerations why this should not be the default, at:
https://lists.gnu.org/r/coreutils/2018-06/msg00034.html

* m4/af_alg.m4: Require --with-linux-crypto to enable.
* m4/gl-openssl.m4: Tweak accordingly.

ChangeLog
m4/af_alg.m4
m4/gl-openssl.m4

index fbf20a9bd20059f6ee45119aff536d27baac022f..520d015ad5af802d29c63a2ba296ea84b6dcdae4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        * tests/test-wcwidth.c (main): If the wchar-single module is present,
        skip the tests in the C locale.
 
+2018-06-24  Pádraig Brady  <P@draigBrady.com>
+
+       af_alg: disable kernel hash functions by default
+       All the kernel routines were seen to be significantly slower
+       with these relatively recent components on an i3-2310M system:
+         kernel-4.10.6-200.fc25.x86_64
+         openssl-1.0.2m-1.fc25.x86_64
+       sha1 was nearly twice as slow in the kernel for example.
+       Further considerations why this should not be the default, at:
+       https://lists.gnu.org/r/coreutils/2018-06/msg00034.html
+
+       * m4/af_alg.m4: Require --with-linux-crypto to enable.
+       * m4/gl-openssl.m4: Tweak accordingly.
+
 2018-06-24  Pádraig Brady  <P@draigBrady.com>
 
        af_alg: avoid hangs when reading from streams
index 325ab1319848cafe7cc896115b96cfbf79b49261..1b890620725667f43849108806e612991bc072d7 100644 (file)
@@ -29,16 +29,20 @@ AC_DEFUN_ONCE([gl_AF_ALG],
       [Define to 1 if you have 'struct sockaddr_alg' defined.])
   fi
 
-  dnl The default is to use AF_ALG if available.
-  use_af_alg=yes
+  dnl The default is to not use AF_ALG if available,
+  dnl as it's system dependent as to whether the kernel
+  dnl routines are faster than libcrypto for example.
+  use_af_alg=no
   AC_ARG_WITH([linux-crypto],
-    [AS_HELP_STRING([[--without-linux-crypto]],
-       [Do not use Linux kernel cryptographic API
-        (default is to use it if available)])],
+    [AS_HELP_STRING([[--with-linux-crypto]],
+       [use Linux kernel cryptographic API (if available)])],
     [use_af_alg=$withval],
-    [use_af_alg=yes])
+    [use_af_alg=no])
   dnl We cannot use it if it is not available.
   if test "$gl_cv_header_linux_if_alg_salg" != yes; then
+    if test "$use_af_alg" != no; then
+      AC_MSG_WARN([Linux kernel cryptographic API not found])
+    fi
     use_af_alg=no
   fi
 
index 5316e769ae106a507551f248b0d929bab25c622e..1d8d8313b1a3e6390878f9dec8556e2379fc949e 100644 (file)
@@ -24,7 +24,7 @@ AC_DEFUN([gl_CRYPTO_CHECK],
        'yes', 'no', 'auto' => use if available,
        'optional' => use if available and warn if not available;
        default is ']gl_CRYPTO_CHECK_DEFAULT['.
-       Note also --without-linux-crypto, which will disable
+       Note also --with-linux-crypto, which will enable
        use of kernel crypto routines, which have precedence])],
     [],
     [with_openssl=$with_openssl_default])