Re: [PATCH] crypto: sm3 - use the more precise type u32 instead of unsigned int

2021-03-26 Thread Gilad Ben-Yossef
t; for (i = 0; i <= 15; i++) > @@ -123,8 +123,8 @@ static void sm3_compress(u32 *w, u32 *wt, u32 *m) > > static void sm3_transform(struct sm3_state *sst, u8 const *src) > { > - unsigned int w[68]; > - unsigned int wt[64]; > + u32 w[68]; > + u32 wt[64]; > > sm3_expand((u32 *)src, w, wt); > sm3_compress(w, wt, sst->state); > -- > 2.19.1.3.ge56e4f7 > -- Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!

Re: [RESEND 07/19] crypto: ccree: convert tasklets to use new tasklet_setup() API

2020-12-08 Thread Gilad Ben-Yossef
drvdata->request_mgr_handle; > + from_tasklet(request_mgr_handle, t, comptask); > + struct cc_drvdata *drvdata = container_of((void *)request_mgr_handle, > +typeof(*drvdata), request_mgr_handle); > struct device *dev = drvdata_to_dev(drvdata); > u32 irq; > > -- > 2.25.1 > Other than that it looks good to me. Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!

Re: [PATCH v3 0/4] crypto: switch to crypto API for EBOIV generation

2020-12-02 Thread Gilad Ben-Yossef
Hi, On Thu, Oct 29, 2020 at 12:05 PM Gilad Ben-Yossef wrote: > > > This series creates an EBOIV template that produces a skcipher > transform which passes through all operations to the skcipher, while > using the same skcipher and key to encrypt the input IV, which is > assu

Re: [PATCH 075/141] crypto: ccree - Fix fall-through warnings for Clang

2020-11-21 Thread Gilad Ben-Yossef
LOCK_SIZE)) > return 0; > + break; > default: > break; > } > + break; > default: > break; > } > -- > 2.27.0 > Acked-by: Gilad Ben-Yossef Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!

[PATCH v3] crypto: ccree - rework cache parameters handling

2020-11-21 Thread Gilad Ben-Yossef
Rework the setting of DMA cache parameters, program more appropriate values and explicitly set sharability domain. Signed-off-by: Gilad Ben-Yossef --- Changes from previous versions: - After discussion with Rob H., drop notion of setting the parameters from device tree and just use good

Re: [PATCH 1/2] dt-bindings: crypto: update ccree optional params

2020-11-19 Thread Gilad Ben-Yossef
Hi, On Tue, Nov 17, 2020 at 4:07 PM Robin Murphy wrote: > > On 2020-11-16 18:54, Rob Herring wrote: > > On Thu, Oct 22, 2020 at 1:18 AM Gilad Ben-Yossef > > wrote: > >> ... > > IMO if this is like PL330 where you just stick some raw AXI attributes > in a

Re: [PATCH 1/2] dt-bindings: crypto: update ccree optional params

2020-11-19 Thread Gilad Ben-Yossef
he > > device tree source (which makes sense of course) but also the driver > > supporting their platform. > > It now looks like we've come a full circle to me :-) > > As I said, if the h/w is 'exactly the same' (hint: it rarely is), then > use a fallback compatible. Then the new SoC specific compatible is > there just in case. > > Think of compatible just as a VID/PID in PCI and USB land (though the > closest thing to a fallback there is class codes). They are the only > way we can uniquely identify h/w. Thanks Rob, this makes sense. Gilad -- Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!

Re: [PATCH 1/2] dt-bindings: crypto: update ccree optional params

2020-11-16 Thread Gilad Ben-Yossef
On Mon, Nov 16, 2020 at 8:54 PM Rob Herring wrote: > > On Thu, Oct 22, 2020 at 1:18 AM Gilad Ben-Yossef wrote: > > > > > > Hi again, > > > > Any opinion on the suggested below? > > Sorry, lost in the pile... No problem at all. I know how it is... &

[PATCH v2 1/2] dt-bindings: crypto: update ccree optional params

2020-11-11 Thread Gilad Ben-Yossef
Document ccree driver supporting new optional parameters allowing to override cache parameters. Signed-off-by: Gilad Ben-Yossef Cc: Rob Herring --- Documentation/devicetree/bindings/crypto/arm-cryptocell.txt | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree

[PATCH v2 2/2] crypto: ccree - add custom cache params from DT file

2020-11-11 Thread Gilad Ben-Yossef
Add optinal ability to override cache parameters and set new defaults. Signed-off-by: Gilad Ben-Yossef Cc: Rob Herring --- drivers/crypto/ccree/cc_driver.c | 100 ++- drivers/crypto/ccree/cc_driver.h | 4 +- drivers/crypto/ccree/cc_pm.c | 2 +- 3 files

[PATCH v2 0/2] add optional cache params override from DT

2020-11-11 Thread Gilad Ben-Yossef
ng of the setting clearer. Gilad Ben-Yossef (2): dt-bindings: crypto: update ccree optional params crypto: ccree - add custom cache params from DT file .../bindings/crypto/arm-cryptocell.txt| 4 + drivers/crypto/ccree/cc_driver.c | 100 +++--- drivers/crypto/

Re: [PATCH v3 1/4] crypto: add eboiv as a crypto API template

2020-10-30 Thread Gilad Ben-Yossef
Hi, On Fri, Oct 30, 2020 at 12:33 PM Milan Broz wrote: > > On 29/10/2020 11:05, Gilad Ben-Yossef wrote: > > > > +config CRYPTO_EBOIV > > + tristate "EBOIV support for block encryption" > > + default DM_CRYPT > > + select CRYPTO_CBC &g

[PATCH v3 3/4] dm crypt: switch to EBOIV crypto API template

2020-10-29 Thread Gilad Ben-Yossef
Replace the explicit EBOIV handling in the dm-crypt driver with calls into the crypto API, which now possesses the capability to perform this processing within the crypto subsystem. Signed-off-by: Gilad Ben-Yossef --- drivers/md/dm-crypt.c | 61 ++- 1

[PATCH v3 4/4] crypto: ccree: re-introduce ccree eboiv support

2020-10-29 Thread Gilad Ben-Yossef
BitLocker eboiv support, which was removed in commit 1d8b41ff6991 ("crypto: ccree - remove bitlocker cipher") is reintroduced based on the crypto API new support for eboiv. Signed-off-by: Gilad Ben-Yossef Fixes: 1d8b41ff6991 ("crypto: ccree - remove bitlocker cipher") ---

[PATCH v3 2/4] crypto: add eboiv(cbc(aes)) test vectors

2020-10-29 Thread Gilad Ben-Yossef
Add test vectors for the use of the EBOIV template with cbc(aes) modes as it is being used by dm-crypt for BitLocker support. Vectors taken from dm-crypt test suite images. Signed-off-by: Gilad Ben-Yossef --- crypto/tcrypt.c | 9 ++ crypto/testmgr.c | 6 + crypto/testmgr.h | 279

[PATCH v3 0/4] crypto: switch to crypto API for EBOIV generation

2020-10-29 Thread Gilad Ben-Yossef
-crypt test suite and on an arm 32 bit board with the CryptoCell hardware. Since no offical source for eboiv test vectors is known, the test vectors supplied as patch #2 are derived from sectors which are part of the dm-crypt test suite. Signed-off-by: Gilad Ben-Yossef Cc: Eric Biggers Cc: Milan Broz

[PATCH v3 1/4] crypto: add eboiv as a crypto API template

2020-10-29 Thread Gilad Ben-Yossef
5.6. This patch re-implements eboiv as a generic crypto API template, thus allowing use of a alternative architecture specific optimzied implementations (as well as saving a memory allocation along the way). Signed-off-by: Gilad Ben-Yossef Cc: Eric Biggers --- crypto/Kconfig | 23 + crypto

[PATCH v2 4/4] crypto: ccree: re-introduce ccree eboiv support

2020-10-28 Thread Gilad Ben-Yossef
BitLocker eboiv support, which was removed in commit 1d8b41ff6991 ("crypto: ccree - remove bitlocker cipher") is reintroduced based on the crypto API new support for eboiv. Signed-off-by: Gilad Ben-Yossef Fixes: 1d8b41ff6991 ("crypto: ccree - remove bitlocker cipher") ---

[PATCH v2 1/4] crypto: add eboiv as a crypto API template

2020-10-28 Thread Gilad Ben-Yossef
5.6. This patch re-implements eboiv as a generic crypto API template, thus allowing use of a alternative architecture specific optimzied implementations (as well as saving a memory allocation along the way). Signed-off-by: Gilad Ben-Yossef Cc: Eric Biggers --- crypto/Kconfig | 23 crypto

[PATCH v2 3/4] dm crypt: switch to EBOIV crypto API template

2020-10-28 Thread Gilad Ben-Yossef
Replace the explicit EBOIV handling in the dm-crypt driver with calls into the crypto API, which now possesses the capability to perform this processing within the crypto subsystem. Signed-off-by: Gilad Ben-Yossef --- drivers/md/dm-crypt.c | 61 ++- 1

[PATCH v2 2/4] crypto: add eboiv(cbc(aes)) test vectors

2020-10-28 Thread Gilad Ben-Yossef
Add test vectors for the use of the EBOIV template with cbc(aes) modes as it is being used by dm-crypt for BitLocker support. Vectors taken from dm-crypt test suite images. Signed-off-by: Gilad Ben-Yossef --- crypto/tcrypt.c | 9 ++ crypto/testmgr.c | 6 + crypto/testmgr.h | 279

[PATCH v2 0/4] crypto: switch to crypto API for EBOIV generation

2020-10-28 Thread Gilad Ben-Yossef
test suite and on an arm 32 bit board with the CryptoCell hardware. Since no offical source for eboiv test vectors is known, the test vectors supplied as patch #2 are derived from sectors which are part of the dm-crypt test suite. Signed-off-by: Gilad Ben-Yossef Cc: Eric Biggers Cc: Milan Broz

Re: [PATCH 3/4] dm crypt: switch to EBOIV crypto API template

2020-10-28 Thread Gilad Ben-Yossef
-crypt so it seems that setting CONFIG_EBOIV default to dm-crypto Kconfig option value does solves the problem, or have I missed something? Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!

Re: [PATCH 3/4] dm crypt: switch to EBOIV crypto API template

2020-10-27 Thread Gilad Ben-Yossef
On Mon, Oct 26, 2020 at 9:04 PM Milan Broz wrote: > > > > On 26/10/2020 19:39, Eric Biggers wrote: > > On Mon, Oct 26, 2020 at 07:29:57PM +0100, Milan Broz wrote: > >> On 26/10/2020 18:52, Eric Biggers wrote: > >>> On Mon, Oct 26, 2020 at 03:04:46PM +0200,

Re: [PATCH 1/4] crypto: add eboiv as a crypto API template

2020-10-26 Thread Gilad Ben-Yossef
t eboiv_instance_ctx *ictx; > struct skcipher_alg *alg; > u32 mask; > int err; ... Thank you very much for the review and assistance. I will send out a revised version. Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!

[PATCH 4/4] crypto: ccree: re-introduce ccree eboiv support

2020-10-26 Thread Gilad Ben-Yossef
BitLocker eboiv support, which was removed in commit 1d8b41ff6991 ("crypto: ccree - remove bitlocker cipher") is reintroduced based on the crypto API new support for eboiv. Signed-off-by: Gilad Ben-Yossef Fixes: 1d8b41ff6991 ("crypto: ccree - remove bitlocker cipher") ---

[PATCH 3/4] dm crypt: switch to EBOIV crypto API template

2020-10-26 Thread Gilad Ben-Yossef
Replace the explicit EBOIV handling in the dm-crypt driver with calls into the crypto API, which now possesses the capability to perform this processing within the crypto subsystem. Signed-off-by: Gilad Ben-Yossef --- drivers/md/Kconfig| 1 + drivers/md/dm-crypt.c | 61

[PATCH 2/4] crypto: add eboiv(cbc(aes)) test vectors

2020-10-26 Thread Gilad Ben-Yossef
Add test vectors for the use of the EBOIV template with cbc(aes) modes as it is being used by dm-crypt for BitLocker support. Vectors taken from dm-crypt test suite images. Signed-off-by: Gilad Ben-Yossef --- crypto/tcrypt.c | 9 ++ crypto/testmgr.c | 6 + crypto/testmgr.h | 279

[PATCH 0/4] crypto: switch to crypto API for EBOIV generation

2020-10-26 Thread Gilad Ben-Yossef
test suite and on an arm 32 bit board with the CryptoCell hardware. Since no offical source for eboiv test vectors is known, the test vectors supplied as patch #2 are derived from sectors which are part of the dm-crypt test suite. Gilad Ben-Yossef (4): crypto: add eboiv as a crypto API template

[PATCH 1/4] crypto: add eboiv as a crypto API template

2020-10-26 Thread Gilad Ben-Yossef
5.6. This patch re-implements eboiv as a generic crypto API template, thus allowing use of a alternative architecture specific optimzied implementations (as well as saving a memory allocation along the way). Signed-off-by: Gilad Ben-Yossef --- crypto/Kconfig | 21 crypto/Makefile | 1

Re: [PATCH 1/2] dt-bindings: crypto: update ccree optional params

2020-09-29 Thread Gilad Ben-Yossef
Hןת On Wed, Sep 23, 2020 at 4:57 AM Rob Herring wrote: > > On Wed, Sep 16, 2020 at 10:19:49AM +0300, Gilad Ben-Yossef wrote: > > Document ccree driver supporting new optional parameters allowing to > > customize the DMA transactions cache parameters and ACE bus sharabil

Re: [PATCH 2/2] crypto: ccree - add custom cache params from DT file

2020-09-21 Thread Gilad Ben-Yossef
Hi, On Fri, Sep 18, 2020 at 10:39 PM Nick Desaulniers wrote: > > On Thu, Sep 17, 2020 at 12:20 AM Gilad Ben-Yossef wrote: > > ... > > > > I am unable to understand this warning. It looks like it is > > complaining about a FIELD_GET sanity check that is always fals

Re: [PATCH 2/2] crypto: ccree - add custom cache params from DT file

2020-09-17 Thread Gilad Ben-Yossef
hmm... On Wed, Sep 16, 2020 at 4:48 PM kernel test robot wrote: > > url: > https://github.com/0day-ci/linux/commits/Gilad-Ben-Yossef/add-optional-cache-params-from-DT/20200916-152151 > base: > https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git &g

Re: [PATCH v6 7/8] X.509: support OSCCA sm2-with-sm3 certificate verification

2020-09-16 Thread Gilad Ben-Yossef
On Mon, Sep 14, 2020 at 9:34 AM Tianjia Zhang wrote: > > Hi Gilad, > > On 9/13/20 3:12 PM, Gilad Ben-Yossef wrote: > > Hi, > > > > > > On Thu, Sep 3, 2020 at 4:13 PM Tianjia Zhang > > wrote: > >> > >> The digital certificate format

[PATCH 2/2] crypto: ccree - add custom cache params from DT file

2020-09-16 Thread Gilad Ben-Yossef
Add optinal ability to customize DMA transactions cache parameters and ACE bus sharability properties and set new defaults. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_driver.c | 89 ++-- drivers/crypto/ccree/cc_driver.h | 4 +- drivers/crypto/ccree

[PATCH 1/2] dt-bindings: crypto: update ccree optional params

2020-09-16 Thread Gilad Ben-Yossef
Document ccree driver supporting new optional parameters allowing to customize the DMA transactions cache parameters and ACE bus sharability properties. Signed-off-by: Gilad Ben-Yossef --- Documentation/devicetree/bindings/crypto/arm-cryptocell.txt | 4 1 file changed, 4 insertions

[PATCH 0/2] add optional cache params from DT

2020-09-16 Thread Gilad Ben-Yossef
Rework the setting of AXI bus cache parameters, including optionally allowing setting them from device tree Gilad Ben-Yossef (2): dt-bindings: crypto: update ccree optional params crypto: ccree - add custom cache params from DT file .../bindings/crypto/arm-cryptocell.txt| 4

Re: [PATCH v6 7/8] X.509: support OSCCA sm2-with-sm3 certificate verification

2020-09-13 Thread Gilad Ben-Yossef
, sig->data, sig->data_size, > sig->digest); It looks like you are doing a separate init, update, finup every time - I would consider using crypto_shash_digest() in one go. In fact, considering the fact that you are allocating a tfm just for this use and then releasing it, I would consider switching to crypto_shash_tfm_digest() and dropping the kzalloc all together. This should simplify the code a bit. Other than that I don't have anything smart to say :-) Gilad -- Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!

Re: [PATCH 16/22] crypto: ccree - add check for xts input length equal to zero

2020-08-08 Thread Gilad Ben-Yossef
(aes) but also for cts(cbc(aes)) > and cts(cbc(paes)). > > Cc: Gilad Ben-Yossef > Signed-off-by: Andrei Botila > --- > drivers/crypto/ccree/cc_cipher.c | 11 ++- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/crypto/ccree/cc_cipher.c

[PATCH 1/2] crypto: ccree: remove data unit size support

2020-08-04 Thread Gilad Ben-Yossef
Remove the implementaion of automatic advancement of sector size in IV for storage ciphers as its use is not supproted by the kernel. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_cipher.c | 233 +-- drivers/crypto/ccree/cc_driver.h | 1 - 2 files

[PATCH 0/2] Remove none supported ciphers

2020-08-04 Thread Gilad Ben-Yossef
the CryptoCell HW has support for ciphers and modes not supported and used at this time by Linux. Remove the code supporting this in the ccree ddriver until such time support is added in the kernel. Gilad Ben-Yossef (2): crypto: ccree: remove data unit size support crypto: ccree: remove

[PATCH 2/2] crypto: ccree: remove bitlocker cipher

2020-08-04 Thread Gilad Ben-Yossef
Remove the bitlocker cipher which is not supported by the kernel. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_cipher.c | 49 ++-- drivers/crypto/ccree/cc_crypto_ctx.h | 1 - 2 files changed, 3 insertions(+), 47 deletions(-) diff --git a/drivers

Re: [PATCH] crypto: ccree - Delete non-standard algorithms

2020-08-04 Thread Gilad Ben-Yossef
dead code. Thanks, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!

Re: [PATCH v2 1/3] crypto: ccree: fix resource leak on error path

2020-06-21 Thread Gilad Ben-Yossef
x/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=6469e8962c20b580b471790fe42367750599#n785 > Indeed and I did but for some reason I cannot fathom the cover letter did not make it to the list. I will try to resend it now. Gilad -- Gilad Ben-Yossef Chie

[PATCH v2 0/3] fixes and update to essiv support

2020-06-21 Thread Gilad Ben-Yossef
Small fixes and adapt essiv support to the new template format --- Changes from v1: - Incorporate coding style fixes suggested by Markus Elfring. Gilad Ben-Yossef (3): crypto: ccree: fix resource leak on error path crypto: ccree: adapt ccree essiv support to kcapi crypto: ccree: remove

[PATCH v2 0/3] fixes and update to essiv support

2020-06-21 Thread Gilad Ben-Yossef
Small fixes and adapt essiv support to the new template format --- Changes from v1: - Incorporate coding style fixes suggested by Markus Elfring. Gilad Ben-Yossef (3): crypto: ccree: fix resource leak on error path crypto: ccree: adapt ccree essiv support to kcapi crypto: ccree: remove

[PATCH v2 1/3] crypto: ccree: fix resource leak on error path

2020-06-21 Thread Gilad Ben-Yossef
Fix a small resource leak on the error path of cipher processing. Signed-off-by: Gilad Ben-Yossef Fixes: 63ee04c8b491e ("crypto: ccree - add skcipher support") Cc: Markus Elfring --- drivers/crypto/ccree/cc_cipher.c | 30 ++ 1 file changed, 18 inserti

[PATCH v2 3/3] crypto: ccree: remove unused field

2020-06-21 Thread Gilad Ben-Yossef
Remove yet another unused field left over from times gone by. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_cipher.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/crypto/ccree/cc_cipher.c b/drivers/crypto/ccree/cc_cipher.c index 162871464438..442965b4cd9b 100644 --- a

[PATCH v2 2/3] crypto: ccree: adapt ccree essiv support to kcapi

2020-06-21 Thread Gilad Ben-Yossef
. Signed-off-by: Gilad Ben-Yossef Cc: Ard Biesheuvel Cc: Libo Wang Cc: Markus Elfring --- drivers/crypto/ccree/cc_cipher.c | 124 +++ 1 file changed, 93 insertions(+), 31 deletions(-) diff --git a/drivers/crypto/ccree/cc_cipher.c b/drivers/crypto/ccree/cc_cipher.c

Re: [PATCH 2/3] crypto: ccree: adapt ccree essiv support to kcapi

2020-06-21 Thread Gilad Ben-Yossef
estions into consideration and will include them in the next revision of the patch set. Thanks again, Gilad -- Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!

[PATCH 3/3] crypto: ccree: remove unused field

2020-06-21 Thread Gilad Ben-Yossef
Remove yet another unused field left over from times gone by. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_cipher.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/crypto/ccree/cc_cipher.c b/drivers/crypto/ccree/cc_cipher.c index 6575e216262b..79cfb47c759c 100644 --- a

[PATCH 2/3] crypto: ccree: adapt ccree essiv supprot to kcapi

2020-06-21 Thread Gilad Ben-Yossef
key size. Signed-off-by: Gilad Ben-Yossef Cc: Ard Biesheuvel Cc: Libo Wang --- drivers/crypto/ccree/cc_cipher.c | 124 +++ 1 file changed, 93 insertions(+), 31 deletions(-) diff --git a/drivers/crypto/ccree/cc_cipher.c b/drivers/crypto/ccree/cc_cipher.c index

[PATCH 0/3] fixes and update to essiv support

2020-06-21 Thread Gilad Ben-Yossef
Small fixes and adapt essiv support to the new template format Gilad Ben-Yossef (3): crypto: ccree: fix resource leak on error path crypto: ccree: adapt ccree essiv supprot to kcapi crypto: ccree: remove unused field drivers/crypto/ccree/cc_cipher.c | 149

[PATCH 1/3] crypto: ccree: fix resource leak on error path

2020-06-21 Thread Gilad Ben-Yossef
Fix a small resource leak on the error path of cipher processing. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_cipher.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/crypto/ccree/cc_cipher.c b/drivers/crypto/ccree

Re: [RFC/RFT PATCH 0/2] crypto: add CTS output IVs for arm64 and testmgr

2020-05-21 Thread Gilad Ben-Yossef
e refer to patch 2. The .iv_out test vectors were all simply > copied from the appropriate offset into the associated .ctext member. Not surprisingly since to the best of my understanding this behaviour is not strictly specified, ccree currently fails the IV output check with the 2nd version of

Re: [PATCH 06/20] crypto: ccree - use crypto_shash_tfm_digest()

2020-05-03 Thread Gilad Ben-Yossef
ctx_p->user.key + key_len); > + err = crypto_shash_tfm_digest(ctx_p->shash_tfm, > + ctx_p->user.key, key_len, > + ctx_p->user.key + key_len); > if (err) { >

Re: [PATCH] crypto: fix comparison of unsigned expression warnings

2019-10-17 Thread Gilad Ben-Yossef
ct cc_hw_desc desc[MAX_AEAD_SETKEY_SEQ]; > - unsigned int seq_len = 0; > + int seq_len = 0; > struct device *dev = drvdata_to_dev(ctx->drvdata); > const u8 *enckey, *authkey; > int rc; > -- > 2.7.4 > -- Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!

Re: [RFT PATCH 0/3] crypto: s390 - convert to skcipher API

2019-10-16 Thread Gilad Ben-Yossef
do so. It is probably impracticable to test paes algorithms since they rely on keys which are not accessible to the kernel and are typically tied to the specific machine you run on. Gilad -- Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!

Re: [PATCH] crypto: fix comparison of unsigned expression warnings

2019-10-02 Thread Gilad Ben-Yossef
gt; struct cc_crypto_req cc_req = {}; > struct cc_hw_desc desc[MAX_AEAD_SETKEY_SEQ]; > - unsigned int seq_len = 0; > + int seq_len = 0; > struct device *dev = drvdata_to_dev(ctx->drvdata); > const u8 *enckey, *authkey; > int rc; >

Re: [PATCH] crypto: ccree - enable CTS support in AES-XTS

2019-09-09 Thread Gilad Ben-Yossef
On Mon, Sep 9, 2019 at 5:38 PM Ard Biesheuvel wrote: > > On Mon, 9 Sep 2019 at 13:34, Gilad Ben-Yossef wrote: > > > > On Mon, Sep 9, 2019 at 3:20 PM Ard Biesheuvel > > wrote: > > > > > > On Sun, 8 Sep 2019 at 09:04, Uri Shir wrote: > > > &

Re: [PATCH] crypto: ccree - enable CTS support in AES-XTS

2019-09-09 Thread Gilad Ben-Yossef
On Mon, Sep 9, 2019 at 3:20 PM Ard Biesheuvel wrote: > > On Sun, 8 Sep 2019 at 09:04, Uri Shir wrote: > > > > In XTS encryption/decryption the plaintext byte size > > can be >= AES_BLOCK_SIZE. This patch enable the AES-XTS ciphertext > > stealing implementation in ccree driver. > > > > Signed-off

Re: [PATCH] crypto: ccree - enable CTS support in AES-XTS

2019-09-08 Thread Gilad Ben-Yossef
On Sun, Sep 8, 2019 at 11:04 AM Uri Shir wrote: > > In XTS encryption/decryption the plaintext byte size > can be >= AES_BLOCK_SIZE. This patch enable the AES-XTS ciphertext > stealing implementation in ccree driver. > > Signed-off-by: Uri Shir Acked-by: Gilad Ben-Yossef Gilad

Re: [PATCH 5/9] crypto: ccree - Rename arrays to avoid conflict with crypto/sha256.h

2019-09-03 Thread Gilad Ben-Yossef
On Tue, Sep 3, 2019 at 10:51 AM Hans de Goede wrote: > > Hi, > > On 03-09-19 09:45, Gilad Ben-Yossef wrote: > > On Sun, Sep 1, 2019 at 11:36 PM Hans de Goede wrote: > >> > >> Rename the algo_init arrays to cc_algo_init so that they do not conflict > &

Re: [PATCH 5/9] crypto: ccree - Rename arrays to avoid conflict with crypto/sha256.h

2019-09-03 Thread Gilad Ben-Yossef
he renaming. Signed-off-by: Gilad Ben-Yossef Thanks, Gilad

[PATCH 0/2] crypto: ccree: aead fixes

2019-07-29 Thread Gilad Ben-Yossef
Fix AEAD handling of authentication failures. Gilad Ben-Yossef (2): crypto: ccree: use the full crypt length value crypto: ccree: use std api sg_zero_buffer drivers/crypto/ccree/cc_aead.c | 3 ++- drivers/crypto/ccree/cc_buffer_mgr.c | 21 - drivers/crypto/ccree

[PATCH 2/2] crypto: ccree: use std api sg_zero_buffer

2019-07-29 Thread Gilad Ben-Yossef
Replace internal cc_zero_sgl() with kernel API of the same function sg_zero_buffer(). Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_aead.c | 3 ++- drivers/crypto/ccree/cc_buffer_mgr.c | 21 - drivers/crypto/ccree/cc_buffer_mgr.h | 2 -- 3 files changed

[PATCH 1/2] crypto: ccree: use the full crypt length value

2019-07-29 Thread Gilad Ben-Yossef
In case of AEAD decryption verifcation error we were using the wrong value to zero out the plaintext buffer leaving the end of the buffer with the false plaintext. Signed-off-by: Gilad Ben-Yossef Fixes: ff27e85a85bb ("crypto: ccree - add AEAD support") CC: sta...@vger.kernel.o

Re: CAVS test harness

2019-07-10 Thread Gilad Ben-Yossef
On Tue, Jul 9, 2019 at 7:07 PM Bhat, Jayalakshmi Manjunath wrote: > > Hi Gilad, > > Thank you very much for the response. I am an entry level engineer when it > comes to Linux Kernel. I have gone through the testmgr. I am not very clear > on how to use it for KAT (Known answer tests), MMT and M

Re: CAVS test harness

2019-07-09 Thread Gilad Ben-Yossef
implement CAVS test harness as module in Linux kernel? > > > Any information on this will help me very much on implementation. Are you sure the needed tests are not already implemented in the kernel crypto API testmgr? Gilad -- Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!

[PATCH 2/4] crypto: ccree: account for TEE not ready to report

2019-07-02 Thread Gilad Ben-Yossef
: Gilad Ben-Yossef Fixes: ab8ec9658f5a ("crypto: ccree - add FIPS support") CC: sta...@vger.kernel.org # v4.17+ --- drivers/crypto/ccree/cc_fips.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ccree/cc_fips.c b/drivers/crypto/ccree/cc_fi

[PATCH 4/4] crypto: ccree: notify TEE on FIPS tests errors

2019-07-02 Thread Gilad Ben-Yossef
Register a FIPS test failure notifier and use it to notify TEE side of FIPS test failures on our side prior to panic. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_fips.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/crypto/ccree/cc_fips.c b

[PATCH 3/4] crypto: fips: add FIPS test failure notification chain

2019-07-02 Thread Gilad Ben-Yossef
-off-by: Gilad Ben-Yossef --- crypto/fips.c| 11 +++ crypto/testmgr.c | 4 +++- include/linux/fips.h | 7 +++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/crypto/fips.c b/crypto/fips.c index 9dfed122d6da..b30a67b6c441 100644 --- a/crypto/fips.c +++ b

[PATCH 1/4] crypto: ccree: drop legacy ivgen support

2019-07-02 Thread Gilad Ben-Yossef
ccree had a mechanism for IV generation which was not compatible with the Linux seqiv or echainiv iv generator and was never used in any of the upstream versions so drop all the code implementing it. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/Makefile | 2 +- drivers

[PATCH 0/4] crypto: ccree: cleanups, fixes and TEE FIPS support

2019-07-02 Thread Gilad Ben-Yossef
Clean up unused ivgen support code and add support for notifiying Trusted Execution Enviornment of FIPS tests failures in FIPS mode. Gilad Ben-Yossef (4): crypto: ccree: drop legacy ivgen support crypto: ccree: account for TEE not ready to report crypto: fips: add FIPS test failure

[PATCH 0/4] crypto: ccree: minor fixes

2019-06-17 Thread Gilad Ben-Yossef
A bunch of minor fixes and sanity checks Gilad Ben-Yossef (1): crypto: ccree: add HW engine config check Ofir Drang (3): crypto: ccree: Relocate driver irq registration after clk init crypto: ccree: check that cryptocell reset completed crypto: ccree: prevent isr handling in case driver

[PATCH 1/4] crypto: ccree: Relocate driver irq registration after clk init

2019-06-17 Thread Gilad Ben-Yossef
From: Ofir Drang Relocate driver interrupt registration after clk gate enabling. Signed-off-by: Ofir Drang --- drivers/crypto/ccree/cc_driver.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/crypto/ccree/cc_driver.c b/drivers/crypto/ccree/c

[PATCH 2/4] crypto: ccree: check that cryptocell reset completed

2019-06-17 Thread Gilad Ben-Yossef
From: Ofir Drang In case of driver probe and pm resume we need to check that the cryptocell hardware reset cycle is completed. during the reset cycle that Cryptocell provide read only access to the APB interface which allows to verify through the CC registers that the reset is completed. Until re

[PATCH 4/4] crypto: ccree: add HW engine config check

2019-06-17 Thread Gilad Ben-Yossef
Add check to verify the stated device tree HW configuration matches the HW. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_driver.c| 18 ++ drivers/crypto/ccree/cc_driver.h| 3 +++ drivers/crypto/ccree/cc_host_regs.h | 17 + 3 files changed

[PATCH 3/4] crypto: ccree: prevent isr handling in case driver is suspended

2019-06-17 Thread Gilad Ben-Yossef
From: Ofir Drang ccree irq may be shared with other devices, in order to prevent ccree isr handling while device maybe suspended we added a check to verify that the device is not suspended. Signed-off-by: Ofir Drang --- drivers/crypto/ccree/cc_driver.c | 3 +++ drivers/crypto/ccree/cc_pm.c

Re: [STABLE PATCH 1/2] crypto: ccree: zap entire sg on aead request unmap

2019-05-20 Thread Gilad Ben-Yossef
On Mon, May 20, 2019 at 3:09 PM Greg KH wrote: > > On Mon, May 20, 2019 at 02:50:23PM +0300, Gilad Ben-Yossef wrote: > > We were trying to be clever zapping out of the cache only the required > > length out of scatter list on AEAD request completion and getting it > > wron

Re: [PATCH 00/35] crypto: ccree: features and bug fixes for 5.2

2019-05-20 Thread Gilad Ben-Yossef
Hi, On Mon, May 20, 2019 at 12:30 PM Greg KH wrote: > > On Sun, May 19, 2019 at 11:28:05AM +0300, Gilad Ben-Yossef wrote: > > On Sat, May 18, 2019 at 10:36 AM Gilad Ben-Yossef > > wrote: > > > > > > Hi > > > > > > On Fri, May 17, 2019 at

[STABLE PATCH 2/2] crypto: ccree: fix backlog notifications

2019-05-20 Thread Gilad Ben-Yossef
type aware. Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_aead.c| 4 drivers/crypto/ccree/cc_cipher.c | 4 drivers/crypto/ccree/cc_hash.c| 28 +++ drivers/crypto/ccree/cc_request_mgr.c | 11 --- 4 files changed, 36

[STABLE PATCH 1/2] crypto: ccree: zap entire sg on aead request unmap

2019-05-20 Thread Gilad Ben-Yossef
We were trying to be clever zapping out of the cache only the required length out of scatter list on AEAD request completion and getting it wrong. As Knuth said: "when in douby, use brute force". Zap the whole length of the scatter list. Signed-off-by: Gilad Ben-Yossef --- drivers/cr

[STABLE PATCH 0/2] crypto: ccree: fixes backport to 4.19

2019-05-20 Thread Gilad Ben-Yossef
Backport of upstream fixes to 4.19.y, which also applies to 5.0.y and 5.1.y. Gilad Ben-Yossef (2): crypto: ccree: zap entire sg on aead request unmap crypto: ccree: fix backlog notifications drivers/crypto/ccree/cc_aead.c| 4 drivers/crypto/ccree/cc_buffer_mgr.c | 18

Re: [PATCH 00/35] crypto: ccree: features and bug fixes for 5.2

2019-05-19 Thread Gilad Ben-Yossef
On Sat, May 18, 2019 at 10:36 AM Gilad Ben-Yossef wrote: > > Hi > > On Fri, May 17, 2019 at 5:52 PM Greg KH wrote: > > > > On Sun, Apr 21, 2019 at 11:52:55AM +0300, Gilad Ben-Yossef wrote: > > > On Thu, Apr 18, 2019 at 4:39 PM Gilad Ben-Yossef > > > wr

Re: [PATCH 00/35] crypto: ccree: features and bug fixes for 5.2

2019-05-18 Thread Gilad Ben-Yossef
Hi On Fri, May 17, 2019 at 5:52 PM Greg KH wrote: > > On Sun, Apr 21, 2019 at 11:52:55AM +0300, Gilad Ben-Yossef wrote: > > On Thu, Apr 18, 2019 at 4:39 PM Gilad Ben-Yossef > > wrote: > > > > > > A set of new features, mostly support for CryptoCell 713 >

Re: [RFC PATCH cryptodev] crypto: cc_sec_disable can be static

2019-04-28 Thread Gilad Ben-Yossef
On Fri, Apr 26, 2019 at 4:03 AM kbuild test robot wrote: > > > Fixes: f98f6e2134bd ("crypto: ccree - add support for sec disabled mode") > Signed-off-by: kbuild test robot Acked-By: Gilad Ben-Yossef Thanks! Gilad -- Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!

Re: [PATCH 10/24] crypto: ccree - Forbid 2-key 3DES in FIPS mode

2019-04-11 Thread Gilad Ben-Yossef
[ Resent because gmail decided suddenly to send HTML email... ] On Thu, Apr 11, 2019 at 11:51 AM Herbert Xu wrote: > > This patch forbids the use of 2-key 3DES (K1 == K3) in FIPS mode. > > Signed-off-by: Herbert Xu Acked-by: Gilad Ben-Yossef Thank you Herbert! Gilad

Re: [PATCH] crypto: ccree: add missing inline qualifier

2019-02-18 Thread Gilad Ben-Yossef
Hi, On Mon, Feb 18, 2019 at 10:48 AM Geert Uytterhoeven wrote: > > On Mon, Feb 11, 2019 at 3:29 PM Gilad Ben-Yossef wrote: > > Commit 1358c13a48c4 ("crypto: ccree - fix resume race condition on init") > > was missing a "inline" qualifier for stub funct

[PATCH] crypto: ccree: add missing inline qualifier

2019-02-11 Thread Gilad Ben-Yossef
@kernel.org # v4.20 Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_pm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/ccree/cc_pm.h b/drivers/crypto/ccree/cc_pm.h index f62624357020..907a6db4d6c0 100644 --- a/drivers/crypto/ccree/cc_pm.h +++

[PATCH] MAINTAINERS: crypto: ccree: remove co-maintainer

2019-02-07 Thread Gilad Ben-Yossef
The best-laid plans of mice and men often go awry. Remove Yael C. as co-maintainer as she moved on to other endeavours. Signed-off-by: Gilad Ben-Yossef --- MAINTAINERS | 1 - 1 file changed, 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 8c68de3cfd80..45ea92863a05 100644 --- a

[BUGFIX PATCH] crypto: ccree: fix resume race condition on init

2019-02-07 Thread Gilad Ben-Yossef
the race, until commit 8234f6734c5d ("PM-runtime: Switch autosuspend over to using hrtimers") changed that :-) Fix this by seperating the PM setup and enablement and doing the latter only at the end of the init sequence. Signed-off-by: Gilad Ben-Yossef Cc: Vincent Guittot Cc: sta...@

Re: Regression due to "PM-runtime: Switch autosuspend over to using hrtimers"

2019-02-07 Thread Gilad Ben-Yossef
On Thu, Feb 7, 2019 at 10:25 AM Gilad Ben-Yossef wrote: > > > > On Wed, 6 Feb 2019 at 17:40, Gilad Ben-Yossef wrote: > > > > > > Hi all, > > > > > > A regression was spotted in the ccree driver running on Arm 32 bit > > > causing a

Re: Regression due to "PM-runtime: Switch autosuspend over to using hrtimers"

2019-02-07 Thread Gilad Ben-Yossef
Hi, Thank for the quick response. On Wed, Feb 6, 2019 at 6:59 PM Vincent Guittot wrote: > > Hi Gilad, > > On Wed, 6 Feb 2019 at 17:40, Gilad Ben-Yossef wrote: > > > > Hi all, > > > > A regression was spotted in the ccree driver running on Arm 32 bit > >

Regression due to "PM-runtime: Switch autosuspend over to using hrtimers"

2019-02-06 Thread Gilad Ben-Yossef
11.501863] Code: e24ddf6b e1a05000 e5941000 e28d6f6a (e1ca80d0) [ 11.508053] ---[ end trace 19720bed5fe13807 ]--- -- Gilad Ben-Yossef Chief Coffee Drinker values of β will give rise to dom!

Re: [PATCH 2/7] crypto: ccrree: no need to check return value of debugfs_create functions

2019-01-23 Thread Gilad Ben-Yossef
On Wed, Jan 23, 2019 at 3:37 PM Greg Kroah-Hartman wrote: > > On Wed, Jan 23, 2019 at 02:58:22PM +0200, Gilad Ben-Yossef wrote: > > Hi, > > > > On Tue, Jan 22, 2019 at 5:14 PM Greg Kroah-Hartman > > wrote: > > > > > > When calling debug

Re: [PATCH 2/7] crypto: ccrree: no need to check return value of debugfs_create functions

2019-01-23 Thread Gilad Ben-Yossef
d trying to create the files if the directory is not available? Thanks, Gilad > > Cc: Yael Chemla > Cc: Gilad Ben-Yossef > Cc: Herbert Xu > Cc: "David S. Miller" > Cc: linux-crypto@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman > --- > drivers/crypt

[PATCH 0/7] crypto: ccree: bug fixes and cleanups

2019-01-15 Thread Gilad Ben-Yossef
Assorted bug fixes and cleanups Gilad Ben-Yossef (3): crypto: ccree: unmap buffer before copying IV crypto: ccree: shared irq lines are not a bug crypto: ccree: don't copy zero size ciphertext Hadar Gat (4): crypto: ccree: improve error handling crypto: ccree: add error me

[PATCH 1/7] crypto: ccree: improve error handling

2019-01-15 Thread Gilad Ben-Yossef
From: Hadar Gat pass the returned error code to the higher level functions Signed-off-by: Hadar Gat Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_buffer_mgr.c | 74 +--- 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/drivers/crypto/ccree

[PATCH 2/7] crypto: ccree: add error message

2019-01-15 Thread Gilad Ben-Yossef
From: Hadar Gat Add error message in case of too many mlli entries. Signed-off-by: Hadar Gat Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_buffer_mgr.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/ccree/cc_buffer_mgr.c b/drivers/crypto

  1   2   3   4   5   6   7   8   9   10   >