]) # LC_ACCOUNT_PAGE_DIRTIED_3ARGS
#
+# LC_HAVE_CRYPTO_ALLOC_SKCIPHER
+#
+# Kernel version 4.12 commit 7a7ffe65c8c5
+# introduced crypto_alloc_skcipher().
+#
+AC_DEFUN([LC_HAVE_CRYPTO_ALLOC_SKCIPHER], [
+LB_CHECK_COMPILE([if crypto_alloc_skcipher is defined],
+crypto_alloc_skcipher, [
+ #include <crypto/skcipher.h>
+],[
+ crypto_alloc_skcipher(NULL, 0, 0);
+],[
+ AC_DEFINE(HAVE_CRYPTO_ALLOC_SKCIPHER, 1,
+ [crypto_alloc_skcipher is defined])
+])
+]) # LC_HAVE_CRYPTO_ALLOC_SKCIPHER
+
+#
# LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
#
# 4.3 replace interval with interval_exp in 'struct blk_integrity'
LC_BIO_ENDIO_USES_ONE_ARG
LC_SYMLINK_OPS_USE_NAMEIDATA
LC_ACCOUNT_PAGE_DIRTIED_3ARGS
+ LC_HAVE_CRYPTO_ALLOC_SKCIPHER
# 4.3
LC_HAVE_INTERVAL_EXP_BLK_INTEGRITY
#else /* ! SYNC_SKCIPHER_REQUEST_ON_STACK */
+#ifdef HAVE_CRYPTO_ALLOC_SKCIPHER
+
+#define crypto_sync_skcipher crypto_skcipher
+
+#define SYNC_SKCIPHER_REQUEST_ON_STACK SKCIPHER_REQUEST_ON_STACK
+
+#define skcipher_request_set_sync_tfm skcipher_request_set_tfm
+
+#define skcipher_request_set_crypt_iv(d)
+
+#define crypto_sync_skcipher_blocksize crypto_skcipher_blocksize
+
+#define crypto_sync_skcipher_setkey crypto_skcipher_setkey
+
+#define crypto_alloc_sync_skcipher crypto_alloc_skcipher
+
+#define crypto_free_sync_skcipher crypto_free_skcipher
+
+#define crypto_sync_skcipher_ivsize crypto_skcipher_ivsize
+
+#define crypto_skcipher_encrypt_iv(desc, dst, src, blocksize) \
+ crypto_skcipher_encrypt((desc))
+
+#define crypto_skcipher_decrypt_iv(desc, dst, src, blocksize) \
+ crypto_skcipher_decrypt((desc))
+
+#define skcipher_request_zero(req) /* nop */
+
+#else /* ! HAVE_CRYPTO_ALLOC_SKCIPHER */
+
#define crypto_sync_skcipher crypto_blkcipher
#define SYNC_SKCIPHER_REQUEST_ON_STACK(name, tfm) \
#define skcipher_request_zero(req) /* nop */
+#endif /* HAVE_CRYPTO_ALLOC_SKCIPHER */
#endif /* SYNC_SKCIPHER_REQUEST_ON_STACK */
struct gss_keyblock {