[PATCH v2] dm: switch dm-verity to async hash crypto API

2017-02-06 Thread Gilad Ben-Yossef
time when a lot of concurrent file accesses are made to the protected volume. Move DM_VERITY to the asynchronous hash API. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> CC: Eric Biggers <ebigge...@gmail.com> CC: Ondrej Mosnáček <omosnacek+linux-cry...@gmail.com> --- Th

Re: [PATCH] dm: switch dm-verity to async hash crypto API

2017-02-06 Thread Gilad Ben-Yossef
dback. Supporting multiple outstanding async requests is a great idea. I will look into supporting it. Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?" -- Jean-Baptiste Queru

Re: [RFC PATCH v4] IV Generation algorithms for dm-crypt

2017-02-07 Thread Gilad Ben-Yossef
plain64, Qemu Virt platform Arm64) and it works just fine. Tested-by: Gilad Ben-Yossef <gi...@benyossef.com> Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?" -- Jean-Baptiste Queru

Re: [PATCH v2] dm: switch dm-verity to async hash crypto API

2017-02-19 Thread Gilad Ben-Yossef
On Fri, Feb 17, 2017 at 4:47 PM, Gilad Ben-Yossef <gi...@benyossef.com> wrote: > Hi Milan, > > Thank you for the review and testing. > > On Fri, Feb 17, 2017 at 3:00 PM, Milan Broz <gmazyl...@gmail.com> wrote: >> >> On 02/06/2017 02:58 PM, Gilad Ben-Yossef wr

[PATCH v3] dm: switch dm-verity to async hash crypto API

2017-02-19 Thread Gilad Ben-Yossef
time when a lot of concurrent file accesses are made to the protected volume. Move DM_VERITY to the asynchronous hash API. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> CC: Eric Biggers <ebigge...@gmail.com> CC: Ondrej Mosnáček <omosnacek+linux-cry...@gmail.com> CC:

Re: [PATCH v2] dm: switch dm-verity to async hash crypto API

2017-02-17 Thread Gilad Ben-Yossef
Hi Milan, Thank you for the review and testing. On Fri, Feb 17, 2017 at 3:00 PM, Milan Broz <gmazyl...@gmail.com> wrote: > On 02/06/2017 02:58 PM, Gilad Ben-Yossef wrote: >> Use of the synchronous digest API limits dm-verity to using pure >> CPU based algorithm providers

[PATCH] crypto: fix typo in doc

2017-02-13 Thread Gilad Ben-Yossef
Fix a single letter typo in api-skcipher.rst. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- Documentation/crypto/api-skcipher.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/crypto/api-skcipher.rst b/Documentation/crypto/api-skcipher.rst

[PATCH] dm: switch dm-verity to async hash crypto API

2017-01-24 Thread Gilad Ben-Yossef
real0m 33.96s user0m 1.10s sys 0m 8.00s All measurements done on a dual core Zynq ZC706 development board with an Armv7 processors. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/md/dm-verity-fec.c| 4 +- drivers/md/dm-verity-target.c

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

2017-01-19 Thread Gilad Ben-Yossef
On Thu, Jan 19, 2017 at 6:42 AM, Binoy Jayan <binoy.ja...@linaro.org> wrote: > Hi Gilad, > > On 18 January 2017 at 20:51, Gilad Ben-Yossef <gi...@benyossef.com> wrote: >> I have some review comments and a bug report - > > Thank you very much for testing this

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

2017-01-18 Thread Gilad Ben-Yossef
sg_out, Also, where do the scatterlist src2 and dst2 that you use sg_set_page() get sg_init_table() called on? I couldn't figure it out... Last but not least, when performing the following sequence on Arm64 (on latest Qemu Virt platform) - 1. cryptsetup luksFormat fs3.img 2. cryptsetup open --type luk

Re: [RFC PATCH v4] IV Generation algorithms for dm-crypt

2017-03-01 Thread Gilad Ben-Yossef
d potentially multiple hardware implementations and putting this in the crypto API domain is the way to abstract this so you use the one that works best of your platform. Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?" -- Jean-Baptiste Queru

Re: [RFC PATCH v4] IV Generation algorithms for dm-crypt

2017-03-01 Thread Gilad Ben-Yossef
On Wed, Mar 1, 2017 at 11:29 AM, Milan Broz <gmazyl...@gmail.com> wrote: > > On 03/01/2017 09:30 AM, Gilad Ben-Yossef wrote: > > On Tue, Feb 28, 2017 at 11:05 PM, Milan Broz <gmazyl...@gmail.com> wrote: > >> > >> On 02/22/2017 07:12 AM, Bino

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

2017-01-03 Thread Gilad Ben-Yossef
w. > Good idea. I wanted to test the patch but alas it does not apply cleanly. You seem to have a blank line at the end of files and other small transgressions that makes checkpatch grumpy. Also... > > Not-signed-off-by: Binoy Jayan <binoy.ja...@linaro.org> What is N

Re: Is the asynchronous hash crypto API asynchronous?

2017-01-09 Thread Gilad Ben-Yossef
15:45:37 CET schrieb Gilad Ben-Yossef: > > Hi Gilad, > >> ahash_request_set_callback(req, 0, NULL, NULL); > >> >> Would anyone be kind enough to enlighten me? > > The documentation got out of sync with the real world. I will file a patch for > t

Is the asynchronous hash crypto API asynchronous?

2017-01-08 Thread Gilad Ben-Yossef
us except that will not work with the code example in api-intro.rst. So... I am totally confused. The documentation claims this is an asynchronous interface, but then its own code examples beg to differ and actual implementations varies. Would anyone be kind enough to enlighten me? Many thanks, Gi

[PATCH v3 RESEND] dm: switch dm-verity to async hash crypto API

2017-04-12 Thread Gilad Ben-Yossef
time when a lot of concurrent file accesses are made to the protected volume. Move DM_VERITY to the asynchronous hash API. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> Tested-by: Milan Broz <gmazyl...@gmail.com> CC: Eric Biggers <ebigge...@gmail.com> CC: Ondrej Mosnáček &l

Re: [PATCH 0/4] staging: add ccree crypto driver

2017-04-19 Thread Gilad Ben-Yossef
On Tue, Apr 18, 2017 at 6:39 PM, Greg Kroah-Hartman <gre...@linuxfoundation.org> wrote: > On Tue, Apr 18, 2017 at 05:07:50PM +0300, Gilad Ben-Yossef wrote: >> Arm TrustZone CryptoCell 700 is a family of cryptographic hardware >> accelerators. It is supported by a long lived

Re: [PATCH 0/4] staging: add ccree crypto driver

2017-04-19 Thread Gilad Ben-Yossef
t > should be something like "arm,cryptocell-712-ree" (and each variant > should have its own string). Got it. Will change. Thanks for the review even in this unconventional form :-) ! > > I don't have documentation to hand to attempt to review the rest. > > I would appre

[PATCH v2 5/9] staging: ccree: add AEAD support

2017-04-20 Thread Gilad Ben-Yossef
Add CryptoCell AEAD support Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/Kconfig |1 + drivers/staging/ccree/Makefile |2 +- drivers/staging/ccree/cc_crypto_ctx.h | 21 + drivers/staging/ccree/ssi_aead.c

[PATCH v2 6/9] staging: ccree: add FIPS support

2017-04-20 Thread Gilad Ben-Yossef
Add FIPS mode support to CryptoCell driver Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/Kconfig |9 + drivers/staging/ccree/Makefile |1 + drivers/staging/ccree/ssi_aead.c|6 + drivers/staging/ccree/ssi_ci

[PATCH v2 4/9] staging: ccree: add IV generation support

2017-04-20 Thread Gilad Ben-Yossef
Add CryptoCell IV hardware generation support. This patch adds the needed support to drive the HW but does not expose the ability via the kernel crypto API yet. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/Makefile | 2 +- drivers/staging

[PATCH v2 7/9] staging: ccree: add TODO list

2017-04-20 Thread Gilad Ben-Yossef
Add TODO list for moving out of staging tree for ccree crypto driver Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/TODO | 28 1 file changed, 28 insertions(+) create mode 100644 drivers/staging/ccree/TODO diff --git a/d

[PATCH v2 8/9] staging: ccree: add DT bindings for Arm CryptoCell

2017-04-20 Thread Gilad Ben-Yossef
This adds DT bindings for the Arm TrustZone CryptoCell cryptographic accelerator IP. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- .../devicetree/bindings/crypto/arm-cryptocell.txt | 27 ++ 1 file changed, 27 insertions(+) create mode 100644 drivers/s

[PATCH v2 9/9] MAINTAINERS: add Gilad BY as ccree maintainer

2017-04-20 Thread Gilad Ben-Yossef
I work for Arm on maintaining the TrustZone CryptoCell driver. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 676c139..f21caa1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -

[PATCH v2 3/9] staging: ccree: add skcipher support

2017-04-20 Thread Gilad Ben-Yossef
Add CryptoCell skcipher support Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/Kconfig |8 + drivers/staging/ccree/Makefile |2 +- drivers/staging/ccree/cc_crypto_ctx.h | 21 + drivers/staging/ccree/ssi_buffer_mgr.c

Re: [PATCH v2 0/9] staging: ccree: add Arm TrustZone CryptoCell REE driver

2017-04-20 Thread Gilad Ben-Yossef
On Thu, Apr 20, 2017 at 4:30 PM, Greg Kroah-Hartman <gre...@linuxfoundation.org> wrote: > On Thu, Apr 20, 2017 at 04:12:54PM +0300, Gilad Ben-Yossef wrote: >> Arm TrustZone CryptoCell 700 is a family of cryptographic hardware >> accelerators. It is supported by a long lived

[PATCH v2 2/9] staging: ccree: add ahash support

2017-04-20 Thread Gilad Ben-Yossef
Add CryptoCell async. hash and HMAC support. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/Kconfig |6 + drivers/staging/ccree/Makefile |2 +- drivers/staging/ccree/cc_crypto_ctx.h | 22 + drivers/staging/ccree/hash_defs.h

Re: [PATCH v2 1/9] staging: ccree: introduce CryptoCell HW driver

2017-04-20 Thread Gilad Ben-Yossef
On Thu, Apr 20, 2017 at 4:33 PM, Greg Kroah-Hartman <gre...@linuxfoundation.org> wrote: > On Thu, Apr 20, 2017 at 04:12:55PM +0300, Gilad Ben-Yossef wrote: >> +++ b/drivers/staging/ccree/bsp.h >> @@ -0,0 +1,21 @@ >> +/* >> + * Copyright (C) 2012-2

Re: [PATCH 0/4] staging: add ccree crypto driver

2017-04-18 Thread Gilad Ben-Yossef
Hi Mark, On Tue, Apr 18, 2017 at 6:13 PM, Mark Rutland <mark.rutl...@arm.com> wrote: > Hi, > > On Tue, Apr 18, 2017 at 05:07:50PM +0300, Gilad Ben-Yossef wrote: >> Arm TrustZone CryptoCell 700 is a family of cryptographic hardware >> accelerators. It is supported by

[PATCH 0/4] staging: add ccree crypto driver

2017-04-18 Thread Gilad Ben-Yossef
. A Git repository based off of Linux 4.11-rc7 is available at https://github.com/gby/linux.git branch ccree. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> CC: Binoy Jayan <binoy.ja...@linaro.org> CC: Ofir Drang <ofir.dr...@arm.com> Gilad Ben-Yossef (4): staging: add c

[PATCH v3 07/15] staging: ccree: add TODO list

2017-04-23 Thread Gilad Ben-Yossef
Add TODO list for moving out of staging tree for ccree crypto driver Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/TODO | 30 ++ 1 file changed, 30 insertions(+) create mode 100644 drivers/staging/ccree/TODO diff --git a/d

[PATCH v3 06/15] staging: ccree: add FIPS support

2017-04-23 Thread Gilad Ben-Yossef
Add FIPS mode support to CryptoCell driver Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/Kconfig |9 + drivers/staging/ccree/Makefile |1 + drivers/staging/ccree/ssi_aead.c|6 + drivers/staging/ccree/ssi_ci

Re: [PATCH v2 1/9] staging: ccree: introduce CryptoCell HW driver

2017-04-23 Thread Gilad Ben-Yossef
his fixed up. This issue, along with some others pointed by reviewers, are fixed in v3 of the patch set. I will be happy if you choose to take it into the staging tree and will continue to work to cut down the TODO list. Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?" -- Jean-Baptiste Queru

[PATCH v3 05/15] staging: ccree: add AEAD support

2017-04-23 Thread Gilad Ben-Yossef
Add CryptoCell AEAD support Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/Kconfig |1 + drivers/staging/ccree/Makefile |2 +- drivers/staging/ccree/cc_crypto_ctx.h | 21 + drivers/staging/ccree/ssi_aead.c

[PATCH v3 08/15] staging: ccree: add DT bindings for Arm CryptoCell

2017-04-23 Thread Gilad Ben-Yossef
This adds DT bindings for the Arm TrustZone CryptoCell cryptographic accelerator IP. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- .../devicetree/bindings/crypto/arm-cryptocell.txt | 27 ++ 1 file changed, 27 insertions(+) create mode 100644 drivers/s

[PATCH v3 11/15] staging: ccree: fix platform_no_drv_owner.cocci warnings

2017-04-23 Thread Gilad Ben-Yossef
From: kbuild test robot <l...@intel.com> drivers/staging/ccree/ssi_driver.c:484:6-11: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Gil

[PATCH v3 13/15] staging: ccree: fix array_size.cocci warnings

2017-04-23 Thread Gilad Ben-Yossef
.cocci Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> Signed-off-by: Fengguang Wu <fengguang...@intel.com> --- drivers/staging/ccree/ssi_sysfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ccree/ssi_sysfs.c b/drivers/staging/ccree

[PATCH v3 14/15] staging: ccree: fix ifnullfree.cocci warnings

2017-04-23 Thread Gilad Ben-Yossef
values. NULL check before some freeing functions is not needed. Based on checkpatch warning "kfree(NULL) is safe this check is probably not required" and kfreeaddr.cocci by Julia Lawall. Generated by: scripts/coccinelle/free/ifnullfree.cocci Signed-off-by: Gilad Ben-Yossef <gi...@be

[PATCH v3 09/15] MAINTAINERS: add Gilad BY as ccree maintainer

2017-04-23 Thread Gilad Ben-Yossef
I work for Arm on maintaining the TrustZone CryptoCell driver. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 676c139..f21caa1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -

[PATCH v3 12/15] staging: ccree: fix semicolon.cocci warnings

2017-04-23 Thread Gilad Ben-Yossef
From: kbuild test robot <l...@intel.com> drivers/staging/ccree/ssi_request_mgr.c:623:3-4: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> Signed-off-by: Fengguang W

[PATCH v3 10/15] staging: ccree: remove useless NULL test of field

2017-04-23 Thread Gilad Ben-Yossef
Remove kbuild test robot reported NULL check for a struct field address. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> Reported-by: kbuild test robot <fengguang...@intel.com> --- drivers/staging/ccree/ssi_buffer_mgr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)

[PATCH v3 04/15] staging: ccree: add IV generation support

2017-04-23 Thread Gilad Ben-Yossef
Add CryptoCell IV hardware generation support. This patch adds the needed support to drive the HW but does not expose the ability via the kernel crypto API yet. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/Makefile | 2 +- drivers/staging

[PATCH v3 00/15] staging: ccree: add Arm TrustZone CryptoCell REE driver

2017-04-23 Thread Gilad Ben-Yossef
. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> CC: Binoy Jayan <binoy.ja...@linaro.org> CC: Ofir Drang <ofir.dr...@arm.com> CC: Stuart Yoder <stuart.yo...@arm.com> CC: Stephan Muller <smuel...@chronox.de> Changes from v2: - Fix stupid build error on i386 due

[PATCH v3 15/15] staging: ccree: fix ifnullfree.cocci warnings

2017-04-23 Thread Gilad Ben-Yossef
is probably not required" and kfreeaddr.cocci by Julia Lawall. Generated by: scripts/coccinelle/free/ifnullfree.cocci Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> Signed-off-by: Fengguang Wu <fengguang...@intel.com> --- drivers/staging/ccree/ssi_hash.c | 27 +-

Re: [PATCH v2 6/9] staging: ccree: add FIPS support

2017-04-23 Thread Gilad Ben-Yossef
t; really necessary to implement a special case for your driver? > > No it isn't. What ever the behavior we need it should be added, pending review of course, to the generic FIPS logic handling. I do wonder if there is value in alternate behavior of stopping crypto API on FIPS error rather than a panic though. I will try to get an explanation why we do it this way. Handling all these has been added to the driver staging TODO list and will be handled before it matures into drivers/crypto/ Many thanks for the review! Gilad -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?" -- Jean-Baptiste Queru

Re: [PATCH v2 6/9] staging: ccree: add FIPS support

2017-04-24 Thread Gilad Ben-Yossef
On Sun, Apr 23, 2017 at 12:48 PM, Gilad Ben-Yossef <gi...@benyossef.com> wrote: > Hi, > > Thank you for the review. > > On Thu, Apr 20, 2017 at 4:39 PM, Stephan Müller <smuel...@chronox.de> wrote: > >>> +/* The function verifies that td

Re: [PATCH v2 6/9] staging: ccree: add FIPS support

2017-04-24 Thread Gilad Ben-Yossef
On Mon, Apr 24, 2017 at 9:16 AM, Stephan Müller <smuel...@chronox.de> wrote: > Am Montag, 24. April 2017, 08:06:09 CEST schrieb Gilad Ben-Yossef: > > Hi Gilad, >> >> Well, it turns out there is and we do :-) >> >> This is from crypto/des_generic.c: >&g

[PATCH v3 03/15] staging: ccree: add skcipher support

2017-04-23 Thread Gilad Ben-Yossef
Add CryptoCell skcipher support Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/Kconfig |8 + drivers/staging/ccree/Makefile |2 +- drivers/staging/ccree/cc_crypto_ctx.h | 21 + drivers/staging/ccree/ssi_buffer_mgr.c

[PATCH v3 02/15] staging: ccree: add ahash support

2017-04-23 Thread Gilad Ben-Yossef
Add CryptoCell async. hash and HMAC support. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/Kconfig |6 + drivers/staging/ccree/Makefile |2 +- drivers/staging/ccree/cc_crypto_ctx.h | 22 + drivers/staging/ccree/hash_defs.h

Re: [RFC PATCH v4] IV Generation algorithms for dm-crypt

2017-03-06 Thread Gilad Ben-Yossef
On Wed, Mar 1, 2017 at 5:38 PM, Milan Broz <gmazyl...@gmail.com> wrote: > > On 03/01/2017 02:04 PM, Milan Broz wrote: >> On 03/01/2017 01:42 PM, Gilad Ben-Yossef wrote: >> ... >> >>> I can certainly understand if you don't wont to take the patch until >&

[PATCH v3 15/22] staging: ccree: fix line indentation and breaks

2017-08-15 Thread Gilad Ben-Yossef
Fix source line indentation and breaks in ssi_aead.c Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_aead.c | 1024 -- 1 file changed, 532 insertions(+), 492 deletions(-) diff --git a/drivers/staging/ccree/ssi_ae

[PATCH v3 20/22] staging: ccree: replace noop macro with inline

2017-08-15 Thread Gilad Ben-Yossef
Replace noop macro with a noop inline function Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_driver.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/ccree/ssi_driver.h b/drivers/staging/ccree/ssi_driver.h

[PATCH v3 18/22] staging: ccree: move over to BIT macro for bit defines

2017-08-15 Thread Gilad Ben-Yossef
Use BIT macro for bit definitions where needed. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_cipher.h | 10 +- drivers/staging/ccree/ssi_driver.c | 3 ++- drivers/staging/ccree/ssi_driver.h | 6 +++--- 3 files changed, 10 insertions

[PATCH v3 17/22] staging: ccree: clean up comments

2017-08-15 Thread Gilad Ben-Yossef
Clean up comments: fix style, trim long lines and remove useless ones. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_aead.c| 40 + drivers/staging/ccree/ssi_aead.h| 47 ++--- drivers/s

[PATCH v3 16/22] staging: ccree: fix spelling mistakes

2017-08-15 Thread Gilad Ben-Yossef
Fix various spelling mistakes in comments. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_cipher.c | 2 +- drivers/staging/ccree/ssi_hash.c| 2 +- drivers/staging/ccree/ssi_hash.h| 2 +- drivers/staging/ccree/ssi_ivgen.c

[PATCH v3 19/22] staging: ccree: fix code indent

2017-08-15 Thread Gilad Ben-Yossef
Fix multiple code indentation issues. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_buffer_mgr.c | 23 --- drivers/staging/ccree/ssi_cipher.c | 2 +- drivers/staging/ccree/ssi_sysfs.c | 4 +++- 3 files changed, 16 inse

[PATCH v3 22/22] staging: ccree: remove BUG macro usage

2017-08-15 Thread Gilad Ben-Yossef
Replace BUG() macro usage that crash the kernel with alternatives that signal error and/or try to recover. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_buffer_mgr.c | 14 ++ drivers/staging/ccree/ssi_cipher.c | 1 - drivers/staging

[PATCH v3 21/22] staging: ccree: save ciphertext for CTS IV

2017-08-15 Thread Gilad Ben-Yossef
The crypto API requires saving the last blocks of ciphertext in req->info for use as IV for CTS mode. The ccree driver was not doing it and so failing tcrypt tests in some situations. This patch fixes the issue. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/stag

[PATCH v3 09/22] staging: ccree: Fix format/argument mismatches

2017-08-15 Thread Gilad Ben-Yossef
ltiple uses of %pad Signed-off-by: Joe Perches <j...@perches.com> [ gby: rebase on top of latest changes ] Acked-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_aead.c| 8 drivers/staging/ccree/ssi_buffer_mgr.c | 29 +--

[PATCH v3 06/22] staging: ccree: simplify resource release on error

2017-08-15 Thread Gilad Ben-Yossef
Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_aead.c | 3 +- drivers/staging/ccree/ssi_cipher.c | 3 +- drivers/staging/ccree/ssi_driver.c | 102 - drivers/staging/ccree/ssi_hash.c | 3 +- 4 files changed, 59 inser

[PATCH v3 07/22] staging: ccree: remove unused completion

2017-08-15 Thread Gilad Ben-Yossef
icache_setup_completion is no longer used. Remove it. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_driver.c | 2 -- drivers/staging/ccree/ssi_driver.h | 1 - 2 files changed, 3 deletions(-) diff --git a/drivers/staging/ccree/ssi_driver.c b/drivers/s

[PATCH v3 08/22] staging: ccree: remove m32r as supported platform

2017-08-15 Thread Gilad Ben-Yossef
M32R requires special handling due due to how it has implemented ioread32. It is also an orphaned arch on Linux and doesn't seem to be worth the trouble. So until we have a real user, remove support for it. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/K

[PATCH v3 04/22] staging: ccree: Convert to devm_ioremap_resource for map, unmap

2017-08-15 Thread Gilad Ben-Yossef
source() releases and unmaps mem region on driver detach. (d) adjust log messages accordingly and remove any blank lines. Signed-off-by: Suniel Mahesh <suni...@techveda.org> [gby: rebase on top of latest coding style fixes changes] Acked-by: Gilad Ben-Yossef <gi...@benyossef.com> --- dri

[PATCH v3 03/22] staging: ccree: Replace kzalloc with devm_kzalloc

2017-08-15 Thread Gilad Ben-Yossef
zalloc() is automatically freed on driver detach, otherwise it leads to a double free. (c) remove unnecessary blank lines. Signed-off-by: Suniel Mahesh <suni...@techveda.org> [gby: rebase on top of latest coding style fixes changes] Acked-by: Gilad Ben-Yossef <gi...@benyossef.com> --- dri

[PATCH v3 02/22] staging: ccree: kmalloc by sizeof var not type

2017-08-15 Thread Gilad Ben-Yossef
Change places where we alloc memory by sizeof type to sizeof var. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_aead.c| 4 ++-- drivers/staging/ccree/ssi_cipher.c | 4 ++-- drivers/staging/ccree/ssi_driver.c | 2 +- drivers/staging

[PATCH v3 10/22] staging: ccree: rewrite GET_DMA_BUFFER_TYPE as func

2017-08-15 Thread Gilad Ben-Yossef
The GET_DMA_BUFFER_TYPE macro was triggering a macro argument reuse warning from checkpatch. Rewrite the macro as inline function instead to avoid risk of unintended side effects. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_buffer_mgr.

[PATCH v3 05/22] staging: ccree: Use platform_get_irq and devm_request_irq

2017-08-15 Thread Gilad Ben-Yossef
stered variable from driver probe as it seems redundant. (e) free_irq is not required any more, devm_request_irq() free's it on driver detach. (f) adjust log messages accordingly and remove any blank lines. Signed-off-by: Suniel Mahesh <suni...@techveda.org> Acked-by: Gilad Ben-Yossef <gi..

[PATCH v3 00/22] staging: ccree: fixes and simplifications

2017-08-15 Thread Gilad Ben-Yossef
t;) Gilad Ben-Yossef (18): staging: ccree: fix split strings staging: ccree: kmalloc by sizeof var not type staging: ccree: simplify resource release on error staging: ccree: remove unused completion staging: ccree: remove m32r as supported platform staging: ccree: rewrite GET_DMA_B

[PATCH v3 13/22] staging: ccree: fix line indentation and breaks

2017-08-15 Thread Gilad Ben-Yossef
Fix source line indentation and breaks Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_hash.c | 494 ++- 1 file changed, 284 insertions(+), 210 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/s

[PATCH v3 11/22] staging: ccree: fix line indentation and breaks

2017-08-15 Thread Gilad Ben-Yossef
Fix wrong indentation and line breaks, including missing tabs, breaking lines longer then 80 char or wrongly broken. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_driver.c | 107 +++-- 1 file changed, 67 insertions(

[PATCH v3 12/22] staging: ccree: align box comment correctly

2017-08-15 Thread Gilad Ben-Yossef
Fix indentation in first comment. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_hash.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging/ccree/ssi_

[PATCH v3 14/22] staging: ccree: fix struct init braces

2017-08-15 Thread Gilad Ben-Yossef
Put struct init braces on line of it's own. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_hash.c | 32 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/drivers/staging/ccree/ssi_hash.c b/drivers/staging

[PATCH v3 01/22] staging: ccree: fix split strings

2017-08-15 Thread Gilad Ben-Yossef
Fix strings in log messages being split across lines and the resulting alignment issues when being fixed. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/staging/ccree/ssi_aead.c| 9 ++-- drivers/staging/ccree/ssi_buffer_mgr.c

Re: [Freedombox-discuss] Hardware Crypto

2017-08-14 Thread Gilad Ben-Yossef
code is rarely > a good idea. Such tests at development time seem like a fine idea, > though; do we have those already? > > What about testing when it is time to decide on kernel configuration; > include a particular module or not? Another issue is whether the > module choice is all

Re: [PATCH] crypto: caam - properly set IV after {en,de}crypt

2017-08-14 Thread Gilad Ben-Yossef
appropriate for -stable) and later, if needed, offload IV updating in HW. > My apologies for reviving this thread from the dead, but doesn't the patch fail for in-place decryption since we are copying from req->dst after the operation is done, and therefore it no longer contains the cipherte

[PATCH v5 00/19] simplify crypto wait for async op

2017-08-14 Thread Gilad Ben-Yossef
patch set. - Rename 'ecr' to 'wait' in fscrypto code. - Split patch introducing the new API from the change moving over the algif code which it originated from to the new API. - Inline crypto_wait_req(). - Some code indentation fixes. Gilad Ben-Yossef (19): crypto: change transient busy r

[PATCH v5 16/19] crypto: talitos: move to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
The talitos driver starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/crypto/talitos.c | 38 +- 1 file changed, 5 insertions(

[PATCH v5 14/19] ima: move to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
ima starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> Acked-by: Mimi Zohar <zo...@linux.vnet.ibm.com> --- security/integrity/ima/ima_c

[PATCH v5 13/19] cifs: move to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
cifs starts an async. crypto op and waits for their completion. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> Acked-by: Pavel Shilovsky <pshi...@microsoft.com> --- fs/cifs/smb2ops.c | 30 -- 1 fil

[PATCH v5 15/19] crypto: tcrypt: move to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
tcrypt starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- crypto/tcrypt.c | 84 + 1 file changed, 25 insertions(

[PATCH v5 08/19] crypto: move drbg to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
for the completion of the request any way. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- crypto/drbg.c | 36 +--- include/crypto/drbg.h | 3 +-- 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/crypto/drbg.c b/crypto/drbg.c

[PATCH v5 02/19] crypto: ccp: use -EAGAIN for transient busy indication

2017-08-14 Thread Gilad Ben-Yossef
Replace -EBUSY with -EAGAIN when reporting transient busy indication in the absence of backlog. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/crypto/ccp/ccp-crypto-main.c | 8 +++- drivers/crypto/ccp/ccp-dev.c | 7 +-- 2 files changed, 8 insertions

[PATCH v5 01/19] crypto: change transient busy return code to -EAGAIN

2017-08-14 Thread Gilad Ben-Yossef
st_flags(req) & CRYPTO_TFM_REQ_MAY_BACKLOG))) This patch changes the return code used to indicate a crypto op failed due to the transformation provider being transiently busy to -EAGAIN. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- crypto

[PATCH v5 18/19] crypto: mediatek: move to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
The mediatek driver starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/crypto/mediatek/mtk-aes.c | 31 +-- 1 file changed, 5 insertions(

[PATCH v5 17/19] crypto: qce: move to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
The qce driver starts several async crypto ops and waits for their completions. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/crypto/qce/sha.c | 30 -- 1 file changed, 4 insertions(+), 26 del

[PATCH v5 19/19] crypto: adapt api sample to use async. op wait

2017-08-14 Thread Gilad Ben-Yossef
prior to the async op finishing. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- Documentation/crypto/api-samples.rst | 52 +++- 1 file changed, 10 insertions(+), 42 deletions(-) diff --git a/Documentation/crypto/api-samples.rst b/Documentation/cryp

[PATCH v5 10/19] crypto: move testmgr to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
testmgr is starting async. crypto ops and waiting for them to complete. Move it over to generic code doing the same. This also provides a test of the generic crypto async. wait code. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- crypto/testmgr.c

[PATCH v5 12/19] dm: move dm-verity to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
to the async op finishing. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/md/dm-verity-target.c | 81 +++ drivers/md/dm-verity.h| 5 --- 2 files changed, 20 insertions(+), 66 deletions(-) diff --git a/drivers/md/dm-verity-targ

[PATCH v5 11/19] fscrypt: move to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
fscrypt starts several async. crypto ops and waiting for them to complete. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- fs/crypto/crypto.c | 28 fs/crypto/fname.c

[PATCH v5 04/19] crypto: marvell/cesa: remove redundant backlog checks on EBUSY

2017-08-14 Thread Gilad Ben-Yossef
Now that -EBUSY return code only indicates backlog queueing we can safely remove the now redundant check for the CRYPTO_TFM_REQ_MAY_BACKLOG flag when -EBUSY is returned. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- drivers/crypto/marvell/cesa.c | 3 +-- drivers/crypto/marvell/

[PATCH v5 03/19] crypto: remove redundant backlog checks on EBUSY

2017-08-14 Thread Gilad Ben-Yossef
Now that -EBUSY return code only indicates backlog queueing we can safely remove the now redundant check for the CRYPTO_TFM_REQ_MAY_BACKLOG flag when -EBUSY is returned. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- crypto/ahash.c| 12 +++- crypto/cts.c

[PATCH v5 05/19] crypto: introduce crypto wait for async op

2017-08-14 Thread Gilad Ben-Yossef
rolled versions. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> CC: Eric Biggers <ebigge...@gmail.com> --- crypto/api.c | 13 + include/linux/crypto.h | 41 + 2 files changed, 54 insertions(+) diff --git a/crypto/ap

[PATCH v5 06/19] crypto: move algif to generic async completion

2017-08-14 Thread Gilad Ben-Yossef
algif starts several async crypto ops and waits for their completion. Move it over to generic code doing the same. Signed-off-by: Gilad Ben-Yossef <gi...@benyossef.com> --- crypto/af_alg.c | 27 --- crypto/algif_aead.c | 8 crypto/algif_

Re: [PATCH v8 0/4] crypto: add algif_akcipher user space API

2017-08-13 Thread Gilad Ben-Yossef
metric cryptography, I would like to point out that there is both interest and HW support for private symmetric key operations as well, for example for storage encryption via DM-Crypt and fscrypt, so I do hope (and will work on) adding some sort of HW key support the crypto API, community accep

Re: [PATCH] Stagingdriver cctree: Fix for checkpatch warning

2017-07-11 Thread Gilad Ben-Yossef
queue */ > +#define HW_QUEUE_SLOTS_MAX 15 > > #define CC_REG_NAME(word, name) DX_DSCRPTR_QUEUE_WORD ## word ## _ ## name > > -- > 1.8.3.1 > -- Gilad Ben-Yossef Chief Coffee Drinker "If you take a class in large-scale robotics, can you end up in a situation where the homework eats your dog?" -- Jean-Baptiste Queru

Re: HELP writing crypto driver for HW with blocksize hash

2017-07-11 Thread Gilad Ben-Yossef
gt; Your two constraints are actually inter-related - If you can only feed the HW a constant size chunk, than indeed need to keey bytes fed to the driver the are below the chunk size in a software buffer, but than you need the final() method to feed these bytes (padded as needed) to the HW if th

Re: HELP writing crypto driver for HW with blocksize hash

2017-07-11 Thread Gilad Ben-Yossef
On Tue, Jul 11, 2017 at 1:50 PM, Kamil Konieczny <k.koniec...@partner.samsung.com> wrote: > On 11.07.2017 12:30, Gilad Ben-Yossef wrote: >> On Tue, Jul 11, 2017 at 10:52 AM, Kamil Konieczny >> <k.koniec...@partner.samsung.com> wrote: >>> >>> >>&g

Re: [PATCH 00/10] Fix alignment issues in staging/ccree

2017-07-11 Thread Gilad Ben-Yossef
On Mon, Jul 3, 2017 at 3:28 PM, Simon Sandström <si...@nikanor.nu> wrote: > On Mon, Jul 03, 2017 at 10:19:31AM +0300, Gilad Ben-Yossef wrote: >> but for the few cases where its a complex expression that can be >> broken down like this one: >> >> WARNING: lin

Re: [PATCH 1/2] staging: ccree: remove unnecessary cast on kmalloc

2017-07-11 Thread Gilad Ben-Yossef
> @@ > expression * e; > expression arg1, arg2; > type T; > @@ > > - e=(T*) > + e= > kmalloc(arg1, arg2); > > Signed-off-by: Gustavo A. R. Silva <garsi...@embeddedor.com> For both patches: Acked-by: Gilad Ben-Yossef <gi...@benyossef.com> > --- &

Re: [PATCH 0/5] staging: ccree: fix checkpatch errors

2017-07-11 Thread Gilad Ben-Yossef
Tyler, On Tue, Jul 11, 2017 at 4:38 PM, Gilad Ben-Yossef <gi...@benyossef.com> wrote: > On Mon, Jul 10, 2017 at 12:10 AM, <sleepingzucch...@gmail.com> wrote: >> From: Tyler Olivieri <sleepingzucch...@gmail.com> >> >> This patchset fixes several checkpatc

  1   2   3   4   5   6   7   8   9   >