Re: [PATCH 4/4] crypto: arm/crct10dif - port x86 SSE implementation to ARM

2016-11-28 Thread Herbert Xu
On Thu, Nov 24, 2016 at 05:32:42PM +, Ard Biesheuvel wrote: > On 24 November 2016 at 15:43, Ard Biesheuvel > wrote: > > This is a straight transliteration of the Intel algorithm implemented > > using SSE and PCLMULQDQ instructions that resides under in the file > >

[PATCH] crypto: arm64/sha2: add generated .S files to .gitignore

2016-11-28 Thread Ard Biesheuvel
Add the files that are generated by the recently merged OpenSSL SHA-256/512 implementation to .gitignore so Git disregards them when showing untracked files. Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/.gitignore | 2 ++ 1 file changed, 2 insertions(+) create

Re: [PATCH v4] crypto: arm64/sha2: integrate OpenSSL implementations of SHA256/SHA512

2016-11-28 Thread Herbert Xu
On Mon, Nov 28, 2016 at 09:50:33AM +, Ard Biesheuvel wrote: > > Assuming that everyone is happy now (Will?), could we get this one > queued for v4.10? The CRC stuff I sent over the past week can wait for > v4.11 (and I should probably do a v2 roundup with everything > combined), but this patch

[PATCH] crypto: caam: check caam_emi_slow instead of re-lookup platform

2016-11-28 Thread Marcus Folkesson
Signed-off-by: Marcus Folkesson --- Russel King, sorry, I did not see your comment until now. drivers/crypto/caam/ctrl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index

[PATCH v3] crypto: add virtio-crypto driver

2016-11-28 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

Re: [RFC PATCH] crypto: Add IV generation algorithms

2016-11-28 Thread Herbert Xu
On Mon, Nov 21, 2016 at 03:40:09PM +0530, Binoy Jayan wrote: > Currently, the iv generation algorithms are implemented in dm-crypt.c. > The goal is to move these algorithms from the dm layer to the kernel > crypto layer by implementing them as template ciphers so they can be used > in relation

Re: [PATCH v2 1/9] crypto/chcr:Fix memory corruption done

2016-11-28 Thread Herbert Xu
On Mon, Nov 21, 2016 at 09:30:47PM +0530, Harsh Jain wrote: > Fix memory corruption done by *((u32 *)dec_key + k) operation. > > Signed-off-by: Jitendra Lulla Please don't mix substantial changes with cosmetic ones such as moving a function. This should be split into two

Re: [PATCH 2/3] crypto: AF_ALG - disregard AAD buffer space for output

2016-11-28 Thread Herbert Xu
On Sat, Nov 19, 2016 at 10:08:06PM +0100, Stephan Mueller wrote: > > The way to go on this topic would be to use the same logic as the authenc > implementation by using a null cipher for the copy operation. Though, finding > out whether the src and dst buffers are the same is an interesting >

Re: [PATCH] crypto: CTR DRBG - prevent invalid SG mappings

2016-11-28 Thread Herbert Xu
On Sat, Nov 26, 2016 at 09:54:14AM +0100, Stephan Mueller wrote: > Hi Herbert, > > as discussed in another thread, SGs must not be used with stack memory > pointers. This issue was the culprit to the error I see with the CTR DRBG. > The > attached patch fixes the issue. Sorry but your patch

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

2016-11-28 Thread Herbert Xu
On Tue, Nov 22, 2016 at 03:44:02PM +0200, Horia Geantă wrote: > 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.

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

2016-11-28 Thread Herbert Xu
On Tue, Nov 22, 2016 at 10:32:44AM +0100, Jean Delvare wrote: > 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

[PATCH RESEND] crypto: CTR DRBG - prevent invalid SG mappings

2016-11-28 Thread Stephan Mueller
When using SGs, only heap memory (memory that is valid as per virt_addr_valid) is allowed to be referenced. The CTR DRBG used to reference the caller-provided memory directly in an SG. In case the caller provided stack memory pointers, the SG mapping is not considered to be valid. In some cases,

Re: [PATCH] crypto: acomp - don't use stack buffer in test_acomp()

2016-11-28 Thread Herbert Xu
On Wed, Nov 23, 2016 at 10:24:35AM -0800, Eric Biggers wrote: > With virtually-mapped stacks (CONFIG_VMAP_STACK=y), using the > scatterlist crypto API with stack buffers is not allowed, and with > appropriate debugging options will cause the > 'BUG_ON(!virt_addr_valid(buf));' in sg_set_buf() to be

Re: [PATCH v4] crypto: arm64/sha2: integrate OpenSSL implementations of SHA256/SHA512

2016-11-28 Thread Will Deacon
On Mon, Nov 28, 2016 at 02:17:34PM +0100, Ard Biesheuvel wrote: > On 28 November 2016 at 13:05, Will Deacon wrote: > > On Sun, Nov 20, 2016 at 11:42:01AM +, Ard Biesheuvel wrote: > >> This integrates both the accelerated scalar and the NEON implementations > >> of

Re: [PATCH v4] crypto: arm64/sha2: integrate OpenSSL implementations of SHA256/SHA512

2016-11-28 Thread Will Deacon
On Sun, Nov 20, 2016 at 11:42:01AM +, Ard Biesheuvel wrote: > This integrates both the accelerated scalar and the NEON implementations > of SHA-224/256 as well as SHA-384/512 from the OpenSSL project. > > Relative performance compared to the respective generic C versions: > >

[PATCH v3] virtio-crypto: add Linux driver

2016-11-28 Thread Gonglei
v3: - set cpu affinity when data queues are not equal to the number of online cpus. [Michael] - add TODO comments for cpu hotplug (changing the relationship of binding virtqueue and cpu) - use __u32/64 in the config space since the virtio->get() doesn't support byte-swap yet. [Michael] -

Re: [PATCH v3] crypto: add virtio-crypto driver

2016-11-28 Thread Cornelia Huck
On Mon, 28 Nov 2016 20:08:23 +0800 Gonglei wrote: > +static int virtcrypto_update_status(struct virtio_crypto *vcrypto) > +{ > + u32 status; > + int err; > + > + virtio_cread(vcrypto->vdev, > + struct virtio_crypto_config, status, ); > + > + /*

Re: [PATCH v4] crypto: arm64/sha2: integrate OpenSSL implementations of SHA256/SHA512

2016-11-28 Thread Ard Biesheuvel
On 28 November 2016 at 13:05, Will Deacon wrote: > On Sun, Nov 20, 2016 at 11:42:01AM +, Ard Biesheuvel wrote: >> This integrates both the accelerated scalar and the NEON implementations >> of SHA-224/256 as well as SHA-384/512 from the OpenSSL project. >> >> Relative

Re: [PATCH 4/4] crypto: arm/crct10dif - port x86 SSE implementation to ARM

2016-11-28 Thread Ard Biesheuvel
On 28 November 2016 at 14:17, Herbert Xu wrote: > On Thu, Nov 24, 2016 at 05:32:42PM +, Ard Biesheuvel wrote: >> On 24 November 2016 at 15:43, Ard Biesheuvel >> wrote: >> > This is a straight transliteration of the Intel algorithm

Re: [PATCH v3] crypto: add virtio-crypto driver

2016-11-28 Thread kbuild test robot
Hi Gonglei, [auto build test ERROR on cryptodev/master] [also build test ERROR on v4.9-rc7 next-20161128] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Gonglei/crypto-add-virtio-crypto-driver

Re: [PATCH v3] crypto: add virtio-crypto driver

2016-11-28 Thread Stefan Hajnoczi
On Mon, Nov 28, 2016 at 08:08:23PM +0800, Gonglei wrote: > 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 >

Re: [PATCH v3] crypto: add virtio-crypto driver

2016-11-28 Thread Michael S. Tsirkin
On Mon, Nov 28, 2016 at 04:20:55PM +, Stefan Hajnoczi wrote: > On Mon, Nov 28, 2016 at 08:08:23PM +0800, Gonglei wrote: > > 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

Re: [PATCH v3] crypto: add virtio-crypto driver

2016-11-28 Thread Halil Pasic
On 11/28/2016 06:19 PM, Michael S. Tsirkin wrote: >>> +static int virtio_crypto_alg_ablkcipher_init_session( >>> > > + struct virtio_crypto_ablkcipher_ctx *ctx, >>> > > + uint32_t alg, const uint8_t *key, >>> > > + unsigned int keylen, >>> > > +

[cryptodev:master 90/113] crypto/xts.c:254:2-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorgani

2016-11-28 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master head: eb0955935e2ae3aa1fc9c34ec684ffe086e81da7 commit: f1c131b45410a202eb45cc55980a7a9e4e4b4f40 [90/113] crypto: xts - Convert to skcipher coccinelle warnings: (new ones prefixed by >>) >>

[PATCH] crypto: fix ifnullfree.cocci warnings

2016-11-28 Thread kbuild test robot
crypto/xts.c:254:2-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. NULL check before some freeing functions is not needed. Based on

[cryptodev:master 102/113] ERROR: "simd_skcipher_free" [arch/arm/crypto/aes-arm-bs.ko] undefined!

2016-11-28 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master head: eb0955935e2ae3aa1fc9c34ec684ffe086e81da7 commit: 211f41af534ad426199a523e4cfec2034a2bdef7 [102/113] crypto: aesbs - Convert to skcipher config: arm-defconfig (attached as .config) compiler:

[cryptodev:master 109/113] drivers/crypto/caam/caamalg_desc.c:67:27: warning: cast to pointer from integer of different size

2016-11-28 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master head: eb0955935e2ae3aa1fc9c34ec684ffe086e81da7 commit: 8cea7b66b821fd914aa26a2af156604f9ef5f709 [109/113] crypto: caam - refactor encryption descriptors generation config: arm-allmodconfig (attached as

[cryptodev:master 99/113] ERROR: "simd_skcipher_free" [arch/arm/crypto/aes-arm-ce.ko] undefined!

2016-11-28 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master head: eb0955935e2ae3aa1fc9c34ec684ffe086e81da7 commit: da40e7a4ba4d6391a797f4bdbd6d534067d87087 [99/113] crypto: aes-ce - Convert to skcipher config: arm-defconfig (attached as .config) compiler:

[cryptodev:master 98/113] arch/arm64/crypto/aes-glue.c:353: undefined reference to `simd_skcipher_free'

2016-11-28 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master head: eb0955935e2ae3aa1fc9c34ec684ffe086e81da7 commit: d0ed0db149fce92f4d69490f18be23ddc470bf6f [98/113] crypto: arm64/aes - Convert to skcipher config: arm64-defconfig (attached as .config) compiler:

[PATCH] crypto: fix ifnullfree.cocci warnings

2016-11-28 Thread kbuild test robot
crypto/lrw.c:313:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. NULL check before some freeing functions is not needed. Based on

[cryptodev:master 89/113] crypto/lrw.c:313:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorgani

2016-11-28 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master head: eb0955935e2ae3aa1fc9c34ec684ffe086e81da7 commit: 700cb3f5fe755b1a2d0f5cf3ae89ad7ef69d321f [89/113] crypto: lrw - Convert to skcipher coccinelle warnings: (new ones prefixed by >>) >>

RE: [virtio-dev] Re: [PATCH v3] crypto: add virtio-crypto driver

2016-11-28 Thread Gonglei (Arei)
> > Subject: [virtio-dev] Re: [PATCH v3] crypto: add virtio-crypto driver > > On Mon, 28 Nov 2016 20:08:23 +0800 > Gonglei wrote: > > > +static int virtcrypto_update_status(struct virtio_crypto *vcrypto) > > +{ > > + u32 status; > > + int err; > > + > > +

RE: [PATCH v3] crypto: add virtio-crypto driver

2016-11-28 Thread Gonglei (Arei)
Hi Michael and Stefan, > > Subject: Re: [PATCH v3] crypto: add virtio-crypto driver > > On Mon, Nov 28, 2016 at 04:20:55PM +, Stefan Hajnoczi wrote: > > On Mon, Nov 28, 2016 at 08:08:23PM +0800, Gonglei wrote: > > > This patch introduces virtio-crypto driver for Linux Kernel. > > > > > > The

RE: [PATCH v3] crypto: add virtio-crypto driver

2016-11-28 Thread Gonglei (Arei)
Hi Halil, > > On 11/28/2016 06:19 PM, Michael S. Tsirkin wrote: > >>> +static int virtio_crypto_alg_ablkcipher_init_session( > >>> > > + struct virtio_crypto_ablkcipher_ctx *ctx, > >>> > > + uint32_t alg, const uint8_t *key, > >>> > > + unsigned int keylen, >

RE: [PATCH v3] crypto: add virtio-crypto driver

2016-11-28 Thread Gonglei (Arei)
> > > > > + > > > > +/* Note: kernel crypto API realization */ > > > > +static int virtio_crypto_ablkcipher_setkey(struct crypto_ablkcipher > > > > *tfm, > > > > +const uint8_t *key, > > > > +unsigned int keylen) > >

Re: [RFC PATCH] crypto: Add IV generation algorithms

2016-11-28 Thread Herbert Xu
On Tue, Nov 29, 2016 at 10:15:40AM +0530, Binoy Jayan wrote: > > Thank you for the reply. The dm-crypt changes are also included as > part of this patchset. It has been tested for functionality as well. > More information can be found in the cover letter including the test > procedure etc. > >

Re: [PATCH] crypto: fix ifnullfree.cocci warnings

2016-11-28 Thread Herbert Xu
On Tue, Nov 29, 2016 at 01:42:38AM +0800, kbuild test robot wrote: > crypto/lrw.c:313:2-7: WARNING: NULL check before freeing functions like > kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not > needed. Maybe consider reorganizing relevant code to avoid passing NULL >

Re: [RFC PATCH] crypto: Add IV generation algorithms

2016-11-28 Thread Binoy Jayan
On 28 November 2016 at 18:17, Herbert Xu wrote: > On Mon, Nov 21, 2016 at 03:40:09PM +0530, Binoy Jayan wrote: >> Currently, the iv generation algorithms are implemented in dm-crypt.c. >> The goal is to move these algorithms from the dm layer to the kernel >> crypto

Re: [RFC PATCH] crypto: Add IV generation algorithms

2016-11-28 Thread Binoy Jayan
Hi Herbert, On 29 November 2016 at 12:58, Herbert Xu wrote: > But that begs the question, who is supposed to use crypto_geniv_set_ctx? > I thought it was dm-crypt but your patch doesn't contain any uses > of it at all. No one is using it as of now. It was just a

Re: [RFC PATCH] crypto: Add IV generation algorithms

2016-11-28 Thread Herbert Xu
On Tue, Nov 29, 2016 at 01:16:46PM +0530, Binoy Jayan wrote: > > No one is using it as of now. It was just a thought to pass context > information, instead of making it part of the context which is shared > among dm-crypt and geniv. OK in that case we should just get rid of it until it's

Re: [PATCH] crypto: vmx - rebuild generated asm when target changes

2016-11-28 Thread Naveen N. Rao
On 2016/11/26 03:24PM, Nicholas Piggin wrote: > Switching from big endian to little endian can fail to regenerate > the crypto assembly properly. Switch to using standard form of > kbuild dependency checking (i.e., use FORCE and if_changed). > > Signed-off-by: Nicholas Piggin

Re: [PATCH] crypto: vmx - rebuild generated asm when target changes

2016-11-28 Thread Nicholas Piggin
On Mon, 28 Nov 2016 13:51:36 +0530 "Naveen N. Rao" wrote: > On 2016/11/26 03:24PM, Nicholas Piggin wrote: > > Switching from big endian to little endian can fail to regenerate > > the crypto assembly properly. Switch to using standard form of > > kbuild

Re: [PATCH v4] crypto: arm64/sha2: integrate OpenSSL implementations of SHA256/SHA512

2016-11-28 Thread Ard Biesheuvel
On 20 November 2016 at 11:43, Ard Biesheuvel wrote: > On 20 November 2016 at 11:42, Ard Biesheuvel > wrote: >> This integrates both the accelerated scalar and the NEON implementations >> of SHA-224/256 as well as SHA-384/512 from the OpenSSL