[PATCH 11/30] crypto: x86/twofish-3way - convert to skcipher interface

2018-02-19 Thread Eric Biggers
From: Eric Biggers Convert the 3-way implementation of Twofish from the (deprecated) blkcipher interface over to the skcipher interface. Signed-off-by: Eric Biggers --- arch/x86/crypto/twofish_glue_3way.c | 151

[PATCH 04/30] crypto: x86/serpent-sse2 - remove XTS algorithm

2018-02-19 Thread Eric Biggers
From: Eric Biggers The XTS template now wraps an ECB mode algorithm rather than the block cipher directly. Therefore it is now redundant for crypto modules to wrap their ECB code with generic XTS code themselves via xts_crypt(). Remove the xts-serpent-sse2 algorithm which

[PATCH 03/30] crypto: x86/serpent-sse2 - remove LRW algorithm

2018-02-19 Thread Eric Biggers
From: Eric Biggers The LRW template now wraps an ECB mode algorithm rather than the block cipher directly. Therefore it is now redundant for crypto modules to wrap their ECB code with generic LRW code themselves via lrw_crypt(). Remove the lrw-serpent-sse2 algorithm which

[PATCH 07/30] crypto: x86/serpent-avx - remove LRW algorithm

2018-02-19 Thread Eric Biggers
From: Eric Biggers The LRW template now wraps an ECB mode algorithm rather than the block cipher directly. Therefore it is now redundant for crypto modules to wrap their ECB code with generic LRW code themselves via lrw_crypt(). Remove the lrw-serpent-avx algorithm which

[PATCH 02/30] crypto: x86/glue_helper - add skcipher_walk functions

2018-02-19 Thread Eric Biggers
From: Eric Biggers Add ECB, CBC, and CTR functions to glue_helper which use skcipher_walk rather than blkcipher_walk. This will allow converting the remaining x86 algorithms from the blkcipher interface over to the skcipher interface, after which we'll be able to remove the

[PATCH 14/30] crypto: x86/cast5-avx - fix ECB encryption when long sg follows short one

2018-02-19 Thread Eric Biggers
From: Eric Biggers With ecb-cast5-avx, if a 128+ byte scatterlist element followed a shorter one, then the algorithm accidentally encrypted/decrypted only 8 bytes instead of the expected 128 bytes. Fix it by setting the encryption/decryption 'fn' correctly. Fixes:

[PATCH 00/30] crypto: x86 glue code cleanup/conversion

2018-02-19 Thread Eric Biggers
Hi, I got tired of seeing some block cipher implementations using the old API (blkcipher or ablkcipher) and some using the new API (skcipher)... so this series makes a dent in the problem by converting all the remaining x86 glue code over to the skcipher API. Besides the conversion to use

[PATCH 01/30] crypto: simd - allow registering multiple algorithms at once

2018-02-19 Thread Eric Biggers
From: Eric Biggers Add a function to crypto_simd that registers an array of skcipher algorithms, then allocates and registers the simd wrapper algorithms for them. It assumes the naming scheme where the names of the underlying algorithms are prefixed with two underscores.

[PATCH 08/30] crypto: x86/serpent-avx,avx2 - convert to skcipher interface

2018-02-19 Thread Eric Biggers
From: Eric Biggers Convert the AVX and AVX2 implementations of Serpent from the (deprecated) ablkcipher and blkcipher interfaces over to the skcipher interface. Note that this includes replacing the use of ablk_helper with crypto_simd. Signed-off-by: Eric Biggers

[PATCH 06/30] crypto: x86/serpent-avx2 - remove LRW algorithm

2018-02-19 Thread Eric Biggers
From: Eric Biggers The LRW template now wraps an ECB mode algorithm rather than the block cipher directly. Therefore it is now redundant for crypto modules to wrap their ECB code with generic LRW code themselves via lrw_crypt(). Remove the lrw-serpent-avx2 algorithm which

[PATCH 09/30] crypto: x86/twofish-3way - remove LRW algorithm

2018-02-19 Thread Eric Biggers
From: Eric Biggers The LRW template now wraps an ECB mode algorithm rather than the block cipher directly. Therefore it is now redundant for crypto modules to wrap their ECB code with generic LRW code themselves via lrw_crypt(). Remove the lrw-twofish-3way algorithm which

[PATCH 05/30] crypto: x86/serpent-sse2 - convert to skcipher interface

2018-02-19 Thread Eric Biggers
From: Eric Biggers Convert the SSE2 implementation of Serpent from the (deprecated) ablkcipher and blkcipher interfaces over to the skcipher interface. Note that this includes replacing the use of ablk_helper with crypto_simd. Signed-off-by: Eric Biggers

[PATCH 10/30] crypto: x86/twofish-3way - remove XTS algorithm

2018-02-19 Thread Eric Biggers
From: Eric Biggers The XTS template now wraps an ECB mode algorithm rather than the block cipher directly. Therefore it is now redundant for crypto modules to wrap their ECB code with generic XTS code themselves via xts_crypt(). Remove the xts-twofish-3way algorithm which

[PATCH 15/30] crypto: x86/cast5-avx - convert to skcipher interface

2018-02-19 Thread Eric Biggers
From: Eric Biggers Convert the AVX implementation of CAST5 from the (deprecated) ablkcipher and blkcipher interfaces over to the skcipher interface. Note that this includes replacing the use of ablk_helper with crypto_simd. Signed-off-by: Eric Biggers

[PATCH 13/30] crypto: x86/twofish-avx - convert to skcipher interface

2018-02-19 Thread Eric Biggers
From: Eric Biggers Convert the AVX implementation of Twofish from the (deprecated) ablkcipher and blkcipher interfaces over to the skcipher interface. Note that this includes replacing the use of ablk_helper with crypto_simd. Signed-off-by: Eric Biggers

[PATCH 18/30] crypto: x86/blowfish: convert to skcipher interface

2018-02-19 Thread Eric Biggers
From: Eric Biggers Convert the x86 asm implementation of Blowfish from the (deprecated) blkcipher interface over to the skcipher interface. Signed-off-by: Eric Biggers --- arch/x86/crypto/blowfish_glue.c | 230

[PATCH 19/30] crypto: x86/des3_ede - convert to skcipher interface

2018-02-19 Thread Eric Biggers
From: Eric Biggers Convert the x86 asm implementation of Triple DES from the (deprecated) blkcipher interface over to the skcipher interface. Signed-off-by: Eric Biggers --- arch/x86/crypto/des3_ede_glue.c | 238

[PATCH 26/30] crypto: xts - remove xts_crypt()

2018-02-19 Thread Eric Biggers
From: Eric Biggers Now that all users of xts_crypt() have been removed in favor of the XTS template wrapping an ECB mode algorithm, remove xts_crypt(). Signed-off-by: Eric Biggers --- crypto/xts.c | 72

[PATCH 27/30] crypto: lrw - remove lrw_crypt()

2018-02-19 Thread Eric Biggers
From: Eric Biggers Now that all users of lrw_crypt() have been removed in favor of the LRW template wrapping an ECB mode algorithm, remove lrw_crypt(). Also remove crypto/lrw.h as that is no longer needed either; and fold 'struct lrw_table_ctx' into 'struct priv',

[PATCH 12/30] crypto: x86/twofish-avx - remove LRW algorithm

2018-02-19 Thread Eric Biggers
From: Eric Biggers The LRW template now wraps an ECB mode algorithm rather than the block cipher directly. Therefore it is now redundant for crypto modules to wrap their ECB code with generic LRW code themselves via lrw_crypt(). Remove the lrw-twofish-avx algorithm which

[PATCH 24/30] crypto: x86/camellia - convert to skcipher interface

2018-02-19 Thread Eric Biggers
From: Eric Biggers Convert the x86 asm implementation of Camellia from the (deprecated) blkcipher interface over to the skcipher interface. Signed-off-by: Eric Biggers --- arch/x86/crypto/camellia_glue.c | 162

[PATCH 28/30] crypto: x86/glue_helper - remove blkcipher_walk functions

2018-02-19 Thread Eric Biggers
From: Eric Biggers Now that all glue_helper users have been switched from the blkcipher interface over to the skcipher interface, remove the versions of the glue_helper functions that handled the blkcipher interface. Signed-off-by: Eric Biggers ---

[PATCH 29/30] crypto: x86/glue_helper - rename glue_skwalk_fpu_begin()

2018-02-19 Thread Eric Biggers
From: Eric Biggers There are no users of the original glue_fpu_begin() anymore, so rename glue_skwalk_fpu_begin() to glue_fpu_begin() so that it matches glue_fpu_end() again. Signed-off-by: Eric Biggers --- arch/x86/crypto/cast5_avx_glue.c |

[PATCH 21/30] crypto: x86/camellia-aesni-avx2 - remove LRW algorithm

2018-02-19 Thread Eric Biggers
From: Eric Biggers The LRW template now wraps an ECB mode algorithm rather than the block cipher directly. Therefore it is now redundant for crypto modules to wrap their ECB code with generic LRW code themselves via lrw_crypt(). Remove the lrw-camellia-aesni-avx2 algorithm

[PATCH 25/30] crypto: x86/camellia-aesni-avx,avx2 - convert to skcipher interface

2018-02-19 Thread Eric Biggers
From: Eric Biggers Convert the AESNI AVX and AESNI AVX2 implementations of Camellia from the (deprecated) ablkcipher and blkcipher interfaces over to the skcipher interface. Note that this includes replacing the use of ablk_helper with crypto_simd. Signed-off-by: Eric

[PATCH 17/30] crypto: x86/cast6-avx - convert to skcipher interface

2018-02-19 Thread Eric Biggers
From: Eric Biggers Convert the AVX implementation of CAST6 from the (deprecated) ablkcipher and blkcipher interfaces over to the skcipher interface. Note that this includes replacing the use of ablk_helper with crypto_simd. Signed-off-by: Eric Biggers

[PATCH 30/30] crypto: ablk_helper - remove ablk_helper

2018-02-19 Thread Eric Biggers
From: Eric Biggers All users of ablk_helper have been converted over to crypto_simd, so remove ablk_helper. Signed-off-by: Eric Biggers --- crypto/Kconfig | 4 -- crypto/Makefile | 1 - crypto/ablk_helper.c | 150

[PATCH 16/30] crypto: x86/cast6-avx - remove LRW algorithm

2018-02-19 Thread Eric Biggers
From: Eric Biggers The LRW template now wraps an ECB mode algorithm rather than the block cipher directly. Therefore it is now redundant for crypto modules to wrap their ECB code with generic LRW code themselves via lrw_crypt(). Remove the lrw-cast6-avx algorithm which did

[PATCH 22/30] crypto: x86/camellia - remove LRW algorithm

2018-02-19 Thread Eric Biggers
From: Eric Biggers The LRW template now wraps an ECB mode algorithm rather than the block cipher directly. Therefore it is now redundant for crypto modules to wrap their ECB code with generic LRW code themselves via lrw_crypt(). Remove the lrw-camellia-asm algorithm which

[PATCH 23/30] crypto: x86/camellia - remove XTS algorithm

2018-02-19 Thread Eric Biggers
From: Eric Biggers The XTS template now wraps an ECB mode algorithm rather than the block cipher directly. Therefore it is now redundant for crypto modules to wrap their ECB code with generic XTS code themselves via xts_crypt(). Remove the xts-camellia-asm algorithm which

[PATCH 20/30] crypto: x86/camellia-aesni-avx - remove LRW algorithm

2018-02-19 Thread Eric Biggers
From: Eric Biggers The LRW template now wraps an ECB mode algorithm rather than the block cipher directly. Therefore it is now redundant for crypto modules to wrap their ECB code with generic LRW code themselves via lrw_crypt(). Remove the lrw-camellia-aesni algorithm

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-19 Thread Horia Geantă
On 2/19/2018 9:58 AM, Christophe LEROY wrote: > Le 18/02/2018 à 18:14, Horia Geantă a écrit : >> There is no ahash_exit() callback mirroring ahash_init(). >> >> The clean-up of request ctx should be done in the last states of the hash >> flows >> described here: >>

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-19 Thread Christophe LEROY
Le 19/02/2018 à 09:30, Horia Geantă a écrit : On 2/19/2018 9:58 AM, Christophe LEROY wrote: Le 18/02/2018 à 18:14, Horia Geantă a écrit : There is no ahash_exit() callback mirroring ahash_init(). The clean-up of request ctx should be done in the last states of the hash flows described here:

[PATCH 4/4] crypto: ccree: replace memset+kfree with kzfree

2018-02-19 Thread Gilad Ben-Yossef
Replace memset to 0 followed by kfree with kzfree for simplicity. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_request_mgr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/ccree/cc_request_mgr.c

[PATCH 3/4] crypto: ccree: add support for older HW revs

2018-02-19 Thread Gilad Ben-Yossef
Add support for the legacy CryptoCell 630 and 710 revs. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/Kconfig | 6 +- drivers/crypto/ccree/cc_aead.c | 34 ++-- drivers/crypto/ccree/cc_cipher.c| 25 +-

[PATCH 2/4] dt-bindings: Add DT bindings for ccree 710 and 630p

2018-02-19 Thread Gilad Ben-Yossef
Add device tree bindings for Arm CryptoCell 710 and 630p hardware revisions. Signed-off-by: Gilad Ben-Yossef --- Documentation/devicetree/bindings/crypto/arm-cryptocell.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH 1/4] crypto: ccree: remove unused definitions

2018-02-19 Thread Gilad Ben-Yossef
Remove enum definition which are not used by the REE interface driver. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_crypto_ctx.h | 20 1 file changed, 20 deletions(-) diff --git a/drivers/crypto/ccree/cc_crypto_ctx.h

[PATCH 0/4] cleanups and new HW rev support

2018-02-19 Thread Gilad Ben-Yossef
This patch set introduces backward compatible support for the older CryptoCell hardware revision 710 and 630 along some minor code cleanups. Gilad Ben-Yossef (4): crypto: ccree: remove unused definitions dt-bindings: Add DT bindings for ccree 710 and 630p crypto: ccree: add support for

[PATCH] crypto: marvell/cesa - Clean up redundant #include

2018-02-19 Thread Robin Murphy
The inclusion of dma-direct.h was only needed temporarily to prevent breakage from the DMA API rework, since the actual CESA fix making it redundant was merged in parallel. Now that both have landed, it can go. Signed-off-by: Robin Murphy --- drivers/crypto/marvell/cesa.c

Re: [PATCH v3 4/4] crypto: add CRYPTO_TFM_REQ_IV_SERIALIZE flag

2018-02-19 Thread Stephan Mueller
Am Sonntag, 18. Februar 2018, 15:25:27 CET schrieb Gilad Ben-Yossef: Hi Gilad, > On Sat, Feb 10, 2018 at 12:04 AM, Stephan Müller wrote: > > Crypto drivers may implement a streamlined serialization support for AIO > > requests that is reported by the

Re: [PATCH 16/18] crypto: talitos - do hw_context DMA mapping outside the requests

2018-02-19 Thread Horia Geantă
On 2/19/2018 11:14 AM, Christophe LEROY wrote: > Le 19/02/2018 à 09:30, Horia Geantă a écrit : >> On 2/19/2018 9:58 AM, Christophe LEROY wrote: >>> Le 18/02/2018 à 18:14, Horia Geantă a écrit : There is no ahash_exit() callback mirroring ahash_init(). The clean-up of request ctx

Re: [PATCH 2/4] dt-bindings: Add DT bindings for ccree 710 and 630p

2018-02-19 Thread Rob Herring
On Mon, Feb 19, 2018 at 02:51:22PM +, Gilad Ben-Yossef wrote: > Add device tree bindings for Arm CryptoCell 710 and 630p hardware > revisions. > > Signed-off-by: Gilad Ben-Yossef > --- > Documentation/devicetree/bindings/crypto/arm-cryptocell.txt | 3 ++- > 1 file