Crypto Fixes for 4.9

2016-11-22 Thread Herbert Xu
Hi Linus: The last push broke algif_hash for all shash implementations, so this is a follow-up to fix that. It also fixes a problem in the crypto scatterwalk that triggers a BUG_ON with certain debugging options due to the new vmalloced-stack code. Please pull from git://git.kernel.org/pub/scm

Re: [PATCH] crypto: powerpc - Rename CRYPT_CRC32C_VPMSUM option

2016-11-22 Thread Anton Blanchard
Hi Jean, > For consistency with the other 246 kernel configuration options, > rename CRYPT_CRC32C_VPMSUM to CRYPTO_CRC32C_VPMSUM. Thanks! Not sure how I missed that. Acked-by: Anton Blanchard Anton -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a mess

[PATCH 06/10] crypto: caam - remove unneded dependencies on CRYPTO_DEV_FSL_CAAM

2016-11-22 Thread Horia Geantă
Remove dependency on CRYPTO_DEV_FSL_CAAM where superfluous: depends on CRYPTO_DEV_FSL_CAAM && CRYPTO_DEV_FSL_CAAM_JR is equivalent to depends on CRYPTO_DEV_FSL_CAAM_JR since CRYPTO_DEV_FSL_CAAM_JR depends on CRYPTO_DEV_FSL_CAAM. Signed-off-by: Horia Geantă --- drivers/crypto/caam/Kconfig | 8 +++

[PATCH 08/10] crypto: caam - consolidate split key length computation

2016-11-22 Thread Horia Geantă
Move split key length and padded length computation from caamalg.c and caamhash.c to key_gen.c. Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c | 24 +++-- drivers/crypto/caam/caamhash.c | 24 ++--- drivers/crypto/caam/key_gen.c | 47 ++

[PATCH 02/10] crypto: caam - group algorithm related params

2016-11-22 Thread Horia Geantă
In preparation of factoring out the shared descriptors, struct alginfo is introduced to group the algorithm related parameters. Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c | 394 +- drivers/crypto/caam/caamhash.c| 48 +++-- drivers/c

[PATCH 03/10] crypto: caam - remove superfluous alg_op algorithm param

2016-11-22 Thread Horia Geantă
Information carried by alg_op can be deduced from adata->algtype plus some fixed flags. Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c | 64 ++ drivers/crypto/caam/caamhash.c | 20 - drivers/crypto/caam/key_gen.c | 7 +++-- dr

[PATCH 10/10] MAINTAINERS: add maintainers for caam crypto driver

2016-11-22 Thread Horia Geantă
Add myself and Dan as maintainers of the caam crypto driver. Cc: Dan Douglass Signed-off-by: Horia Geantă --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 1cd38a7e0064..e28aab4d525a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4972,6

[PATCH 01/10] crypto: caam - move append_key_aead() into init_sh_desc_key_aead()

2016-11-22 Thread Horia Geantă
append_key_aead() is used in only one place, thus inline it. Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index 8db5

[PATCH 00/10] crypto: caam - shared descriptor generation refactoring

2016-11-22 Thread Horia Geantă
In preparation for the caam/qi (Queue Interface) driver, the generation of the shared descriptors is abstracted and exported. This way the existing caam/jr (Job Ring) and caam/qi drivers will have a common base of descriptors. Thanks, Horia Horia Geantă (10): crypto: caam - move append_key_aead

[PATCH 09/10] crypto: caam - refactor ahash shared descriptor generation

2016-11-22 Thread Horia Geantă
Move ahash shared descriptor generation into a single function. Currently there is no plan to support ahash on any other interface besides the Job Ring, thus for now the functionality is not exported. Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamhash.c | 130 --

[PATCH 04/10] crypto: caam - improve key inlining

2016-11-22 Thread Horia Geantă
For authenc / stitched AEAD algorithms, check independently each of the two (authentication, encryption) keys whether inlining is possible. Prioritize the inlining of the authentication key, since the length of the (split) key is bigger than that of the encryption key. For the other algorithms, co

[PATCH 05/10] crypto: caam - rewrite some generic inline append cmds

2016-11-22 Thread Horia Geantă
A few descriptor commands are generated using generic inline append "append_cmd" function. Rewrite them using specific inline append functions. Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c | 20 ++-- drivers/crypto/caam/caamhash.c | 8 2 files changed,

Re: [PATCH v3] arm64/crypto: Accelerated CRC T10 DIF computation

2016-11-22 Thread Ard Biesheuvel
On 22 November 2016 at 12:53, Ard Biesheuvel wrote: > On 22 November 2016 at 10:14, YueHaibing wrote: >> This is the ARM64 CRC T10 DIF transform accelerated with the ARMv8 >> NEON instruction.The config CRYPTO_CRCT10DIF_NEON should be turned >> on to enable the feature.The crc_t10dif crypto libra

Re: [PATCH v3] arm64/crypto: Accelerated CRC T10 DIF computation

2016-11-22 Thread Ard Biesheuvel
On 22 November 2016 at 10:14, YueHaibing wrote: > This is the ARM64 CRC T10 DIF transform accelerated with the ARMv8 > NEON instruction.The config CRYPTO_CRCT10DIF_NEON should be turned > on to enable the feature.The crc_t10dif crypto library function will > use this faster algorithm when crct10di

[v3 PATCH 14/16] crypto: cbc - Convert to skcipher

2016-11-22 Thread Herbert Xu
This patch converts cbc over to the skcipher interface. It also rearranges the code to allow it to be reused by drivers. Signed-off-by: Herbert Xu --- crypto/cbc.c | 242 +-- 1 file changed, 138 insertions(+), 104 deletions(-) diff --gi

[v3 PATCH 16/16] crypto: aesbs - Convert to skcipher

2016-11-22 Thread Herbert Xu
This patch converts aesbs over to the skcipher interface. Signed-off-by: Herbert Xu --- arch/arm/crypto/aesbs-glue.c | 380 +-- 1 file changed, 152 insertions(+), 228 deletions(-) diff --git a/arch/arm/crypto/aesbs-glue.c b/arch/arm/crypto/aesbs-glue.c

[v3 PATCH 15/16] crypto: cbc - Export CBC implementation

2016-11-22 Thread Herbert Xu
This patch moves the core CBC implementation into a header file so that it can be reused by drivers implementing CBC. Signed-off-by: Herbert Xu --- crypto/cbc.c | 129 - include/crypto/cbc.h | 146

[v3 PATCH 6/16] crypto: cryptd - Add support for skcipher

2016-11-22 Thread Herbert Xu
This patch adds skcipher support to cryptd alongside ablkcipher. Signed-off-by: Herbert Xu --- crypto/cryptd.c | 284 +++- include/crypto/cryptd.h | 13 ++ 2 files changed, 294 insertions(+), 3 deletions(-) diff --git a/crypto/cryptd.c b/c

[v3 PATCH 11/16] crypto: aesni - Convert to skcipher

2016-11-22 Thread Herbert Xu
This patch converts aesni (including fpu) over to the skcipher interface. The LRW implementation has been removed as the generic LRW code can now be used directly on top of the accelerated ECB implementation. Signed-off-by: Herbert Xu --- arch/x86/crypto/aesni-intel_glue.c | 705 +++--

[v3 PATCH 8/16] crypto: pcbc - Convert to skcipher

2016-11-22 Thread Herbert Xu
This patch converts lrw over to the skcipher interface. Signed-off-by: Herbert Xu --- crypto/pcbc.c | 201 +++--- 1 file changed, 109 insertions(+), 92 deletions(-) diff --git a/crypto/pcbc.c b/crypto/pcbc.c index f654965..e4538e0 100644 ---

[v3 PATCH 9/16] crypto: glue_helper - Add skcipher xts helpers

2016-11-22 Thread Herbert Xu
This patch adds xts helpers that use the skcipher interface rather than blkcipher. This will be used by aesni_intel. Signed-off-by: Herbert Xu --- arch/x86/crypto/glue_helper.c | 74 +- arch/x86/include/asm/crypto/glue_helper.h | 39 +++

[v3 PATCH 7/16] crypto: simd - Add simd skcipher helper

2016-11-22 Thread Herbert Xu
This patch adds the simd skcipher helper which is meant to be a replacement for ablk helper. It replaces the underlying blkcipher interface with skcipher, and also presents the top-level algorithm as an skcipher. Signed-off-by: Herbert Xu --- crypto/Kconfig |4 crypto/Make

[v3 PATCH 10/16] crypto: testmgr - Do not test internal algorithms

2016-11-22 Thread Herbert Xu
Currently we manually filter out internal algorithms using a list in testmgr. This is dangerous as internal algorithms cannot be safely used even by testmgr. This patch ensures that they're never processed by testmgr at all. This patch also removes an obsolete bypass for nivciphers which no long

[v3 PATCH 12/16] crypto: arm64/aes - Convert to skcipher

2016-11-22 Thread Herbert Xu
This patch converts arm64/aes over to the skcipher interface. Signed-off-by: Herbert Xu --- arch/arm64/crypto/aes-glue.c | 382 +-- 1 file changed, 158 insertions(+), 224 deletions(-) diff --git a/arch/arm64/crypto/aes-glue.c b/arch/arm64/crypto/aes-glu

[v3 PATCH 13/16] crypto: aes-ce - Convert to skcipher

2016-11-22 Thread Herbert Xu
This patch converts aes-ce over to the skcipher interface. Signed-off-by: Herbert Xu --- arch/arm/crypto/aes-ce-glue.c | 390 -- 1 file changed, 157 insertions(+), 233 deletions(-) diff --git a/arch/arm/crypto/aes-ce-glue.c b/arch/arm/crypto/aes-ce-glue

[v3 PATCH 5/16] crypto: api - Do not clear type bits in crypto_larval_lookup

2016-11-22 Thread Herbert Xu
Currently all bits not set in mask are cleared in crypto_larval_lookup. This is unnecessary as wherever the type bits are used it is always masked anyway. This patch removes the clearing so that we may use bits set in the type but not in the mask for special purposes, e.g., picking up internal alg

[v3 PATCH 4/16] crypto: xts - Convert to skcipher

2016-11-22 Thread Herbert Xu
This patch converts xts over to the skcipher interface. It also optimises the implementation to be based on ECB instead of the underlying cipher. For compatibility the existing naming scheme of xts(aes) is maintained as opposed to the more obvious one of xts(ecb(aes)). Signed-off-by: Herbert Xu

[v3 PATCH 3/16] crypto: lrw - Convert to skcipher

2016-11-22 Thread Herbert Xu
This patch converts lrw over to the skcipher interface. It also optimises the implementation to be based on ECB instead of the underlying cipher. For compatibility the existing naming scheme of lrw(aes) is maintained as opposed to the more obvious one of lrw(ecb(aes)). Signed-off-by: Herbert Xu

[v3 PATCH 2/16] crypto: aes-ce-ccm - Use skcipher walk interface

2016-11-22 Thread Herbert Xu
This patch makes use of the new skcipher walk interface instead of the obsolete blkcipher walk interface. Signed-off-by: Herbert Xu --- arch/arm64/crypto/aes-ce-ccm-glue.c | 50 +--- 1 file changed, 13 insertions(+), 37 deletions(-) diff --git a/arch/arm64/cry

[v3 PATCH 1/16] crypto: skcipher - Add skcipher walk interface

2016-11-22 Thread Herbert Xu
This patch adds the skcipher walk interface which replaces both blkcipher walk and ablkcipher walk. Just like blkcipher walk it can also be used for AEAD algorithms. Signed-off-by: Herbert Xu --- crypto/skcipher.c | 511 + include/crypto/in

[v3 PATCH 0/16] crypto: skcipher - skcipher algorithm conversion part 3

2016-11-22 Thread Herbert Xu
Hi: v3 fixes a number of bugs. This patch series is the third instalment of the skcipher conversion. It introduces the skcipher walk interface, and converts a number of core algorithms such as CBC and LRW/XTS, as well as the aesni on x86 and various ARM aes implementations. It also adds an skci

[PATCH v3] arm64/crypto: Accelerated CRC T10 DIF computation

2016-11-22 Thread YueHaibing
This is the ARM64 CRC T10 DIF transform accelerated with the ARMv8 NEON instruction.The config CRYPTO_CRCT10DIF_NEON should be turned on to enable the feature.The crc_t10dif crypto library function will use this faster algorithm when crct10dif_neon module is loaded. Tcrypt benchmark results: HIP0

[PATCH] crypto: powerpc - Rename CRYPT_CRC32C_VPMSUM option

2016-11-22 Thread Jean Delvare
For consistency with the other 246 kernel configuration options, rename CRYPT_CRC32C_VPMSUM to CRYPTO_CRC32C_VPMSUM. Signed-off-by: Jean Delvare Cc: Anton Blanchard Cc: Herbert Xu --- arch/powerpc/crypto/Makefile |2 +- crypto/Kconfig |2 +- 2 files changed, 2 insertions(

[PATCH v2 0/2] virtio-crypto: add Linux driver

2016-11-22 Thread Gonglei
The virtio crypto device is a virtual cryptography device as well as a kind of virtual hardware accelerator for virtual machines. The encryption anddecryption requests are placed in the data queue and are ultimately handled by thebackend crypto accelerators. The second queue is the control queue us

[PATCH v2 1/2] virtio: introduce little edian functions for virtio_cread/write# family

2016-11-22 Thread Gonglei
Virtio modern devices are always little edian, let's introduce the LE functions for read/write configuration space for virtio modern devices, which avoid complaint by Sparse when we use the virtio_creaed/virtio_cwrite in VIRTIO_1 devices. Signed-off-by: Gonglei --- include/linux/virtio_config.h

[PATCH v2 2/2] crypto: add virtio-crypto driver

2016-11-22 Thread Gonglei
This patch introduces virtio-crypto driver for Linux Kernel. The virtio crypto device is a virtual cryptography device as well as a kind of virtual hardware accelerator for virtual machines. The encryption anddecryption requests are placed in the data queue and are ultimately handled by thebackend