Patchwork crypto: virtio - remove dependency on CRYPTO_AUTHENC

login
register
mail settings
Submitter Peter Wu
Date March 6, 2018, 11:53 p.m.
Message ID <20180306235315.11550-1-peter@lekensteyn.nl>
Download mbox | patch
Permalink /patch/10263157/
State Accepted
Delegated to: Herbert Xu
Headers show

Comments

Peter Wu - March 6, 2018, 11:53 p.m.
virtio_crypto does not use function crypto_authenc_extractkeys, remove
this unnecessary dependency. Compiles fine and passes cryptodev-linux
cipher and speed tests from https://wiki.qemu.org/Features/VirtioCrypto

Fixes: dbaf0624ffa5 ("crypto: add virtio-crypto driver")
Signed-off-by: Peter Wu <peter@lekensteyn.nl>
---
Hey Herbert,

I noticed that this module pulled in an additional dependency which seemed
unnecessary. If I'm not mistaken, CONFIG_CRYPTO_AUTHENC is only necessary if you
use crypto_authenc_extractkeys (some other drivers use linux/authenc.h just for
its structure definitions, see

    git grep -ne '\bcrypto_authenc_' \
      $(git grep -ne '\bcrypto_authenc_extractkeys' -l | sed 's,^,:!,')

Scanning the matches, it appears that drivers/staging/ccree/ is the only other
driver which has a seemingly unnecessary dependency on CRYPTO_AUTHENC. Is it
true that such dependencies can be removed?

Kind regards,
Peter
---
 drivers/crypto/virtio/Kconfig                | 1 -
 drivers/crypto/virtio/virtio_crypto_common.h | 1 -
 2 files changed, 2 deletions(-)
Herbert Xu - March 16, 2018, 3:56 p.m.
On Wed, Mar 07, 2018 at 12:53:15AM +0100, Peter Wu wrote:
> virtio_crypto does not use function crypto_authenc_extractkeys, remove
> this unnecessary dependency. Compiles fine and passes cryptodev-linux
> cipher and speed tests from https://wiki.qemu.org/Features/VirtioCrypto
> 
> Fixes: dbaf0624ffa5 ("crypto: add virtio-crypto driver")
> Signed-off-by: Peter Wu <peter@lekensteyn.nl>

Patch applied.  Thanks.

Patch

diff --git a/drivers/crypto/virtio/Kconfig b/drivers/crypto/virtio/Kconfig
index 5db07495ddc5..a4324b1383a4 100644
--- a/drivers/crypto/virtio/Kconfig
+++ b/drivers/crypto/virtio/Kconfig
@@ -2,7 +2,6 @@  config CRYPTO_DEV_VIRTIO
 	tristate "VirtIO crypto driver"
 	depends on VIRTIO
 	select CRYPTO_AEAD
-	select CRYPTO_AUTHENC
 	select CRYPTO_BLKCIPHER
 	select CRYPTO_ENGINE
 	default m
diff --git a/drivers/crypto/virtio/virtio_crypto_common.h b/drivers/crypto/virtio/virtio_crypto_common.h
index e976539a05d9..c76573d45f3b 100644
--- a/drivers/crypto/virtio/virtio_crypto_common.h
+++ b/drivers/crypto/virtio/virtio_crypto_common.h
@@ -24,7 +24,6 @@ 
 #include <linux/spinlock.h>
 #include <crypto/aead.h>
 #include <crypto/aes.h>
-#include <crypto/authenc.h>
 #include <crypto/engine.h>