[PATCH 5/5] crypto: caam/qi2 - add support for Chacha20 + Poly1305

2018-11-08 Thread Horia Geantă
Add support for Chacha20 + Poly1305 combined AEAD: -generic (rfc7539) -IPsec (rfc7634 - known as rfc7539esp in the kernel) Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c | 4 +- drivers/crypto/caam/caamalg_desc.c | 24 ++- drivers/crypto/caam/caamalg_desc.h | 3

[PATCH 4/5] crypto: caam/jr - add support for Chacha20 + Poly1305

2018-11-08 Thread Horia Geantă
Add support for Chacha20 + Poly1305 combined AEAD: -generic (rfc7539) -IPsec (rfc7634 - known as rfc7539esp in the kernel) Signed-off-by: Cristian Stoica Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c | 221 - drivers/crypto/caam

[PATCH 0/5] crypto: caam - add support for Era 10

2018-11-08 Thread Horia Geantă
updating LX2160A dts with: -fsl-mc bus DT node -missing dma-ranges property in soc DT node Cristian Stoica (1): crypto: export CHACHAPOLY_IV_SIZE Horia Geantă (4): crypto: caam - add register map changes cf. Era 10 crypto: caam/qi2 - add support for ChaCha20 crypto: caam/jr - add support

[PATCH 1/5] crypto: caam - add register map changes cf. Era 10

2018-11-08 Thread Horia Geantă
Era 10 changes the register map. The updates that affect the drivers: -new version registers are added -DBG_DBG[deco_state] field is moved to a new register - DBG_EXEC[19:16] @ 8_0E3Ch. Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c| 47 + drivers

[PATCH 3/5] crypto: export CHACHAPOLY_IV_SIZE

2018-11-08 Thread Horia Geantă
From: Cristian Stoica Move CHACHAPOLY_IV_SIZE to header file, so it can be reused. Signed-off-by: Cristian Stoica Signed-off-by: Horia Geantă --- crypto/chacha20poly1305.c | 2 -- include/crypto/chacha20.h | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/crypto

[PATCH 2/5] crypto: caam/qi2 - add support for ChaCha20

2018-11-08 Thread Horia Geantă
Add support for ChaCha20 skcipher algorithm. Signed-off-by: Carmen Iorga Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg_desc.c | 6 -- drivers/crypto/caam/caamalg_qi2.c | 27 +-- drivers/crypto/caam/compat.h | 1 + drivers/crypto/caam/desc.h

[PATCH] crypto: caam - add SPDX license identifier to all files

2018-10-10 Thread Horia Geantă
d by means of MODULE_LICENSE() -files with complete license text -Kconfig Signed-off-by: Horia Geantă --- drivers/crypto/caam/Kconfig| 1 + drivers/crypto/caam/caamalg.c | 1 + drivers/crypto/caam/caamalg_desc.c | 1 + drivers/crypto/caam/caamalg_qi.c | 1 + drivers/crypto/caam/caamhash.

[PATCH] crypto: tcrypt - remove remnants of pcomp-based zlib

2018-09-19 Thread Horia Geantă
Commit 110492183c4b ("crypto: compress - remove unused pcomp interface") removed pcomp interface but missed cleaning up tcrypt. Signed-off-by: Horia Geantă --- crypto/tcrypt.c | 7 +-- crypto/testmgr.h | 2 -- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/crypto/

[PATCH] crypto: caam/jr - fix ablkcipher_edesc pointer arithmetic

2018-09-14 Thread Horia Geantă
DMA mapping and updating") Signed-off-by: Horia Geantă --- This is for crypto-2.6 tree / current v4.19 release cycle. Note that it will create merge conflicts later in v4.20 due to commits cf5448b5c3d8 ("crypto: caam/jr - remove ablkcipher IV generation") 5ca7badb1f62 (&qu

[PATCH] crypto: tcrypt - fix ghash-generic speed test

2018-09-12 Thread Horia Geantă
: # 4.6+ Fixes: 0660511c0bee ("crypto: tcrypt - Use ahash") Tested-by: Franck Lenormand Signed-off-by: Horia Geantă --- crypto/tcrypt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index bdde95e8d369..6e0a054bb61d 100644 --- a/crypto/tcry

[PATCH 1/4] crypto: caam/jr - remove ablkcipher IV generation

2018-08-06 Thread Horia Geantă
IV generation is done only at AEAD level. Support in ablkcipher is not needed, thus remove the dead code. Link: https://www.mail-archive.com/search?l=mid=20160901101257.ga3...@gondor.apana.org.au Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c | 275

[PATCH 4/4] crypto: caam/qi - ablkcipher -> skcipher conversion

2018-08-06 Thread Horia Geantă
Convert driver from deprecated ablkcipher API to skcipher. Link: https://www.mail-archive.com/search?l=mid=20170728085622.gc19...@gondor.apana.org.au Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c | 12 +- drivers/crypto/caam/caamalg_desc.c | 61 +++--- drivers/crypto

[PATCH 3/4] crypto: caam/jr - ablkcipher -> skcipher conversion

2018-08-06 Thread Horia Geantă
Convert driver from deprecated ablkcipher API to skcipher. Link: https://www.mail-archive.com/search?l=mid=20170728085622.gc19...@gondor.apana.org.au Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c | 448 +++--- drivers/crypto/caam/compat.h

[PATCH 2/4] crypto: caam/qi - remove ablkcipher IV generation

2018-08-06 Thread Horia Geantă
IV generation is done only at AEAD level. Support in ablkcipher is not needed, thus remove the dead code. Link: https://www.mail-archive.com/search?l=mid=20160901101257.ga3...@gondor.apana.org.a Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg_desc.c | 81 drivers

[PATCH 0/4] crypto: caam - ablkcipher -> skcipher conversion

2018-08-06 Thread Horia Geantă
separately: "crypto: caam/qi - fix error path in xts setkey" https://patchwork.kernel.org/patch/10557015 Horia Geantă (4): crypto: caam/jr - remove ablkcipher IV generation crypto: caam/qi - remove ablkcipher IV generation crypto: caam/jr - ablkcipher -> skcipher conversion cr

[PATCH] crypto: caam - fix DMA mapping direction for RSA forms 2 & 3

2018-08-06 Thread Horia Geantă
Cc: # 4.13+ Fixes: 52e26d77b8b3 ("crypto: caam - add support for RSA key form 2") Fixes: 4a651b122adb ("crypto: caam - add support for RSA key form 3") Signed-off-by: Horia Geantă --- drivers/crypto/caam/caampkc.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deleti

[PATCH] crypto: caam/qi - fix error path in xts setkey

2018-08-06 Thread Horia Geantă
xts setkey callback returns 0 on some error paths. Fix this by returning -EINVAL. Cc: # 4.12+ Fixes: b189817cf789 ("crypto: caam/qi - add ablkcipher and authenc algorithms") Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg_qi.c | 6 ++ 1 file changed, 2 insert

[PATCH] crypto: caam/jr - fix descriptor DMA unmapping

2018-08-06 Thread Horia Geantă
Descriptor address needs to be swapped to CPU endianness before being DMA unmapped. Cc: # 4.8+ Fixes: 261ea058f016 ("crypto: caam - handle core endianness != caam endianness") Reported-by: Laurentiu Tudor Signed-off-by: Horia Geantă --- drivers/crypto/caam/jr.c | 3 ++- 1 file

[PATCH] crypto: tcrypt - reschedule during speed tests

2018-07-23 Thread Horia Geantă
Avoid RCU stalls in the case of non-preemptible kernel and lengthy speed tests by rescheduling when advancing from one block size to another. Signed-off-by: Horia Geantă --- crypto/tcrypt.c | 36 1 file changed, 24 insertions(+), 12 deletions(-) diff --git

[PATCH 3/3] crypto: caam/qi - fix warning in init_cgr()

2018-05-23 Thread Horia Geantă
Coverity warns about an "Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)" when computing the congestion threshold value. Even though it is highly unlikely for an overflow to happen, use this as an opportunity to simplify the code. Signed-off-by: Horia Geantă <horia.g

[PATCH 1/3] crypto: caam - fix MC firmware detection

2018-05-23 Thread Horia Geantă
on the presence of "fsl,qoriq-mc" compatible string in the device tree. Fixes: 297b9cebd2fc0 ("crypto: caam/jr - add support for DPAA2 parts") Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/ctrl.c | 21 - drivers/crypto/caa

[PATCH 2/3] crypto: caam - fix rfc4543 descriptors

2018-05-23 Thread Horia Geantă
command to be blocking. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg_desc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/caam/caamalg_desc.c b/drivers/crypto/caam/caamalg_desc.c index 8ae7a1be7dfd..a408edd84f34

[PATCH 4.9.y, 4.14.y] crypto: talitos - fix IPsec cipher in length

2018-05-03 Thread Horia Geantă
gt; # 4.8+ Fixes: 549bd8bc5987 ("crypto: talitos - Implement AEAD for SEC1 using HMAC_SNOOP_NO_AFEU") Reported-by: Horia Geantă <horia.gea...@nxp.com> Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> Tested-by: Horia Geantă <horia.gea...@nxp.com> Signed-off-by: Herbert

[PATCH] crypto: caam - fix size of RSA prime factor q

2018-04-27 Thread Horia Geantă
d-by: David Binderman <dcb...@hotmail.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caampkc.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/caam/caampkc.c b/drivers/crypto/caam/caampkc.c index 6f990139f324..578ea63

Re: [PATCH v2] crypto: caam: - Use kmemdup() function

2018-04-16 Thread Horia Geantă
> Signed-off-by: Fabio Estevam <fabio.este...@nxp.com> Reviewed-by: Horia Geantă <horia.gea...@nxp.com> Thanks, Horia

Re: [PATCH] crypto: caam: - Use kmemdup() function

2018-04-16 Thread Horia Geantă
On 4/16/2018 5:08 PM, Fabio Estevam wrote: > From: Fabio Estevam > > Use kmemdup() rather than duplicating its implementation. > > Detected with Coccinelle script. > > Signed-off-by: Fabio Estevam > --- > drivers/crypto/caam/caampkc.c | 4 +--- >

Re: [PATCH v3] crypto: caam: Drop leading zero from input buffer

2018-04-16 Thread Horia Geantă
On 4/15/2018 6:51 PM, Martin Townsend wrote: > On Sun, Apr 15, 2018 at 3:12 PM, Fabio Estevam wrote: >> From: Fabio Estevam >> >> imx6ul and imx7 report the following error: >> >> caam_jr 2142000.jr1: 4789: DECO: desc idx 7: >> Protocol Size Error -

[PATCH RESEND] crypto: caam - strip input zeros from RSA input buffer

2018-04-16 Thread Horia Geantă
") Cc: <sta...@vger.kernel.org> # 4.8+ Reported-by: Martin Townsend <mtownsend1...@gmail.com> Link: https://lkml.kernel.org/r/cabatt_ytyoryktapcb4izhnanekkgfi9xaqmjhi_n-8ywoc...@mail.gmail.com Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- (Hopefully this one will reach the

Re: CAAM and IMA/EVM : caam_rsa_enc: DECO: desc idx 7: Protocol Size Error

2018-04-13 Thread Horia Geantă
On 4/13/2018 3:12 AM, Fabio Estevam wrote: > Hi Horia, > > On Thu, Apr 12, 2018 at 4:12 AM, Horia Geantă <horia.gea...@nxp.com> wrote: > >> Yes, driver needs to strip off leading zeros from input data before feeding >> it >> to the accelerator. >&

Re: CAAM and IMA/EVM : caam_rsa_enc: DECO: desc idx 7: Protocol Size Error

2018-04-12 Thread Horia Geantă
On 4/11/2018 8:26 PM, Fabio Estevam wrote: > Hi Horia, > > On Wed, Apr 11, 2018 at 7:15 AM, Horia Geantă <horia.gea...@nxp.com> wrote: > >> You'd want to make sure rsa is offloaded to caam in this case - check in >> /proc/crypto. >> IIRC there are som

Re: [PATCH v4 2/2] crypto: caam - allow retrieving 'era' from register

2018-04-11 Thread Horia Geantă
roperty is not passed in the device > tree. > > This function is based on the U-Boot implementation from > drivers/crypto/fsl/sec.c > > Signed-off-by: Fabio Estevam <fabio.este...@nxp.com> Reviewed-by: Horia Geantă <horia.gea...@nxp.com> for the series. Thanks, Horia

Re: [PATCH v3 2/2] crypto: caam - allow retrieving 'era' from register

2018-04-11 Thread Horia Geantă
On 4/11/2018 2:59 PM, Fabio Estevam wrote: > From: Fabio Estevam > > The 'era' information can be retrieved from CAAM registers, so > introduce a caam_get_era_from_hw() function that gets it via register > reads in case the 'fsl,sec-era' property is not passed in the

Re: CAAM and IMA/EVM : caam_rsa_enc: DECO: desc idx 7: Protocol Size Error

2018-04-11 Thread Horia Geantă
On 4/11/2018 1:36 AM, James Bottomley wrote: > On Tue, 2018-04-10 at 23:01 +0100, Martin Townsend wrote: >> Using openssl to get the signature in my x509 cert >> >>    Signature Algorithm: sha256WithRSAEncryption >> 68:82:cc:5d:f9:ee:fb:1a:77:72:a6:a9:c6:4c:cc:d7:f6:2a: >>

Re: CAAM and IMA/EVM : caam_rsa_enc: DECO: desc idx 7: Protocol Size Error

2018-04-11 Thread Horia Geantă
On 4/11/2018 5:21 AM, Fabio Estevam wrote: > Hi Martin, > > On Tue, Apr 10, 2018 at 7:01 PM, Martin Townsend > wrote: > >> A hexdump of the signature reveals a 0x00 at the start > > Yes, same is happening here on my mx6ul evk running linux-next: > [snip] > > However,

Re: [PATCH v2 2/2] crypto: caam - allow retrieving 'era' from register

2018-04-11 Thread Horia Geantă
On 4/11/2018 4:54 AM, Fabio Estevam wrote: > From: Fabio Estevam > > The 'era' information can be retrieved from CAAM registers, so > introduce a caam_get_era_from_hw() function that gets it via register > reads in case the 'fsl,sec-era' property is not passed in the

Re: [PATCH v2 1/2] crypto: caam - staticize caam_get_era()

2018-04-11 Thread Horia Geantă
On 4/11/2018 4:54 AM, Fabio Estevam wrote: > From: Fabio Estevam <fabio.este...@nxp.com> > > caam_get_era() is only used locally, so do not export this function > and make it static instead. > > Signed-off-by: Fabio Estevam <fabio.este...@nxp.com> Reviewed-by: Hori

[PATCH 3/3] crypto: caam/qi - fix IV DMA mapping and updating

2018-03-28 Thread Horia Geantă
380522 ("crypto: caam/qi - properly set IV after {en,de}crypt") Link: http://lkml.kernel.org/r/20170113084620.gf22...@gondor.apana.org.au Reported-by: Gilad Ben-Yossef <gi...@benyossef.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com>

[PATCH 2/3] crypto: caam - fix IV DMA mapping and updating

2018-03-28 Thread Horia Geantă
rly set IV after {en,de}crypt") Link: http://lkml.kernel.org/r/20170113084620.gf22...@gondor.apana.org.au Reported-by: Gilad Ben-Yossef <gi...@benyossef.com> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 212 ++---

[PATCH 0/3] crypto: caam - IV-related fixes

2018-03-28 Thread Horia Geantă
ablkcipher decryption needs special handling since ciphertext will be overwritten by the time we want to update the IV with the last ciphertext block Horia Geantă (3): crypto: caam - fix DMA mapping dir for generated IV crypto: caam - fix IV DMA mapping and updating crypto: caam/qi - fix IV D

[PATCH 1/3] crypto: caam - fix DMA mapping dir for generated IV

2018-03-28 Thread Horia Geantă
In case of GIVCIPHER, IV is generated by the device. Fix the DMA mapping direction. Cc: <sta...@vger.kernel.org> # 3.19+ Fixes: 7222d1a34103 ("crypto: caam - add support for givencrypt cbc(aes) and rfc3686(ctr(aes))") Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --

Re: [PATCH v2 3/9] crypto: caam - don't leak pointers to authenc keys

2018-03-26 Thread Horia Geantă
-by: Tudor Ambarus <tudor.amba...@microchip.com> Reviewed-by: Horia Geantă <horia.gea...@nxp.com> Thanks, Horia

Re: [PATCH v2 4/9] crypto: caam/qi - don't leak pointers to authenc keys

2018-03-26 Thread Horia Geantă
-by: Tudor Ambarus <tudor.amba...@microchip.com> Reviewed-by: Horia Geantă <horia.gea...@nxp.com> Thanks, Horia

Re: [PATCH] crypto: talitos - fix IPsec cipher in length

2018-03-23 Thread Horia Geantă
On 3/22/2018 12:04 PM, Christophe LEROY wrote: > Le 16/03/2018 à 15:07, Horia Geantă a écrit : >> On 3/16/2018 2:42 PM, Christophe LEROY wrote: >>> Le 16/03/2018 à 09:48, Horia Geantă a écrit : >>>> For SEC 2.x+, cipher in length must contain only the ciphertext

Re: [PATCH v2] crypto: doc - clarify hash callbacks state machine

2018-03-20 Thread Horia Geantă
On 3/20/2018 10:50 AM, Kamil Konieczny wrote: > On 20.03.2018 08:56, Horia Geantă wrote: >> Add a note that it is perfectly legal to "abandon" a request object: >> - call .init() and then (as many times) .update() >> - _not_ call any of .final(), .finup() or .expor

[PATCH v2] crypto: doc - clarify hash callbacks state machine

2018-03-20 Thread Horia Geantă
Add a note that it is perfectly legal to "abandon" a request object: - call .init() and then (as many times) .update() - _not_ call any of .final(), .finup() or .export() at any point in future Link: https://lkml.kernel.org/r/20180222114741.ga27...@gondor.apana.org.au Signed-off

Re: [PATCH] crypto: doc - clarify hash callbacks state machine

2018-03-19 Thread Horia Geantă
On 3/19/2018 11:25 AM, Herbert Xu wrote: > On Mon, Mar 19, 2018 at 06:39:50AM +0000, Horia Geantă wrote: >> >> The fact that there can be multiple requests in parallel (for a given tfm) >> is a >> different topic. >> Each request object has its state in its ow

Re: [PATCH] crypto: doc - clarify hash callbacks state machine

2018-03-19 Thread Horia Geantă
On 3/16/2018 5:16 PM, Herbert Xu wrote: > On Mon, Mar 05, 2018 at 12:39:45PM +0200, Horia Geantă wrote: >> Even though it doesn't make too much sense, it is perfectly legal to: >> - call .init() and then (as many times) .update() >> - subseqently _not_ call any of .final()

Re: [PATCH] crypto: talitos - fix IPsec cipher in length

2018-03-16 Thread Horia Geantă
On 3/16/2018 2:42 PM, Christophe LEROY wrote: > Le 16/03/2018 à 09:48, Horia Geantă a écrit : >> For SEC 2.x+, cipher in length must contain only the ciphertext length. >> In case of using hardware ICV checking, the ICV length is provided via >> the "extent"

[PATCH] crypto: talitos - fix IPsec cipher in length

2018-03-16 Thread Horia Geantă
t AEAD for SEC1 using HMAC_SNOOP_NO_AFEU") Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/talitos.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 447cb8b1b16a..61a30704847f 100644 --- a/driver

Re: [PATCH v11 6/7] crypto: caam: cleanup CONFIG_64BIT ifdefs when using io{read|write}64

2018-03-06 Thread Horia Geantă
an Gunthorpe <log...@deltatee.com> > Cc: Andy Shevchenko <andy.shevche...@gmail.com> > Cc: Horia Geantă <horia.gea...@nxp.com> > Cc: Dan Douglass <dan.dougl...@nxp.com> > Cc: Herbert Xu <herb...@gondor.apana.org.au> > Cc: "David S. Miller"

[PATCH] crypto: doc - clarify hash callbacks state machine

2018-03-05 Thread Horia Geantă
: https://lkml.kernel.org/r/20180222114741.ga27...@gondor.apana.org.au Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- Documentation/crypto/devel-algos.rst | 8 1 file changed, 8 insertions(+) diff --git a/Documentation/crypto/devel-algos.rst b/Documentation/crypto/devel-alg

Re: [PATCH 1/2] crypto: talitos - don't persistently map req_ctx->hw_context and req_ctx->buf

2018-03-02 Thread Horia Geantă
data for ahash on > SEC1") > Signed-off-by: Christophe Leroy <christophe.le...@c-s.fr> Tested-by: Horia Geantă <horia.gea...@nxp.com> Please add this to 4.15.y -stable tree. Thanks, Horia

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

2018-02-22 Thread Horia Geantă
On 2/22/2018 1:47 PM, Herbert Xu wrote: > On Tue, Feb 20, 2018 at 11:32:25AM +0000, Horia Geantă wrote: >> >> If final/finup is optional, how is the final hash supposed to be retrieved? > > Sometimes the computation ends with a partial hash, that's what > export is for

Re: [PATCH 4.14, 4.9] crypto: talitos - fix Kernel Oops on hashing an empty file

2018-02-22 Thread Horia Geantă
On 2/22/2018 9:08 AM, Christophe Leroy wrote: > Upstream 87a81dce53b1ea61acaeefa5191a0376a2d1d721 > > Performing the hash of an empty file leads to a kernel Oops > > [ 44.504600] Unable to handle kernel paging request for data at address > 0x000c > [ 44.512819] Faulting instruction

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

2018-02-20 Thread Horia Geantă
On 2/20/2018 12:34 PM, Herbert Xu wrote: > On Mon, Feb 19, 2018 at 01:16:30PM +0000, Horia Geantă wrote: >> >>> And what about ALGIF path from user space ? >>> What if the user never calls the last sendmsg() which will call >>> hash_finup() ? >>

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

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

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

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

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

2018-02-18 Thread Horia Geantă
On 2/17/2018 6:32 PM, Christophe LEROY wrote: > > > Le 07/02/2018 à 15:39, Horia Geantă a écrit : >> On 10/6/2017 4:06 PM, Christophe Leroy wrote: >>> At every request, we map and unmap the same hash hw_context. >>> >>> This patch moves the dma

Re: [PATCH 2/2] crypto: caam: Use common error handling code in four functions

2018-02-15 Thread Horia Geantă
On 2/14/2018 8:32 PM, SF Markus Elfring wrote: > From: Markus Elfring > Date: Wed, 14 Feb 2018 19:14:49 +0100 > > Add jump targets so that a bit of exception handling can be better reused > at the end of these functions. > > Signed-off-by: Markus Elfring

Re: [PATCH 1/2] crypto: caam: Delete an error message for a failed memory allocation in seven functions

2018-02-14 Thread Horia Geantă
le software. > > Signed-off-by: Markus Elfring <elfr...@users.sourceforge.net> Reviewed-by: Horia Geantă <horia.gea...@nxp.com> though please consider the following > @@ -689,10 +687,8 @@ static struct ahash_edesc *ahash_edesc_alloc(struct > caam_hash_ctx *ctx, >

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

2018-02-07 Thread Horia Geantă
On 10/6/2017 4:06 PM, Christophe Leroy wrote: > At every request, we map and unmap the same hash hw_context. > > This patch moves the dma mapping/unmapping in functions ahash_init() > and ahash_import(). > > Signed-off-by: Christophe Leroy > --- >

[PATCH] crypto: caam - fix endless loop when DECO acquire fails

2018-02-05 Thread Horia Geantă
andles") Reported-by: Bryan O'Donoghue <pure.lo...@nexus-software.ie> Suggested-by: Auer Lukas <lukas.a...@aisec.fraunhofer.de> Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/ctrl.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --gi

Re: [PATCH v3 2/5] crypto: caam: Fix endless loop when RNG is already initialized

2018-02-05 Thread Horia Geantă
On 2/2/2018 2:54 PM, Auer, Lukas wrote: > On Fri, 2018-02-02 at 11:20 +, Bryan O'Donoghue wrote: >> On 01/02/18 12:16, Horia Geantă wrote: >>> If the loop cannot exit based on value of "ret" != -EAGAIN, then it >>> means >>> caam_prob

Re: [PATCH v3 2/5] crypto: caam: Fix endless loop when RNG is already initialized

2018-02-01 Thread Horia Geantă
a ("crypto: caam - enable instantiation of all RNG4 state > handles") > > Reported-by: Ryan Harkin <ryan.har...@linaro.org> > Cc: "Horia Geantă" <horia.gea...@nxp.com> > Cc: Aymen Sghaier <aymen.sgha...@nxp.com> > Cc: Fabio Estevam <fa

Re: [PATCH v3 5/5] ARM: dts: imx7s: add CAAM device node

2018-02-01 Thread Horia Geantă
scha Hauer <ker...@pengutronix.de> > Cc: linux-arm-ker...@lists.infradead.org > Cc: "Horia Geantă" <horia.gea...@nxp.com> > Cc: Aymen Sghaier <aymen.sgha...@nxp.com> > Cc: Fabio Estevam <fabio.este...@nxp.com> > Cc: Peng Fan <peng@nxp.com>

[PATCH 2/3] crypto: caam - prepare for gcm(aes) support over QI interface

2018-01-29 Thread Horia Geantă
Update gcm(aes) descriptors (generic, rfc4106 and rfc4543) such that they would also work when submitted via the QI interface. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 19 +++-- drivers/crypto/caam/caamalg_desc.c

[PATCH 3/3] crypto: caam/qi - add GCM support

2018-01-29 Thread Horia Geantă
by HW to the right with 0x_0001 (up to 16 bytes - AES block size), according to the GCM specification. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg_qi.c | 374 +++ 1 file changed, 374 insertions(+) diff --git a/d

[PATCH 1/3] crypto: caam/qi - return -EBADMSG for ICV check failure

2018-01-29 Thread Horia Geantă
Crypto drivers are expected to return -EBADMSG in case of ICV check (authentication) failure. In this case it also makes sense to suppress the error message in the QI dequeue callback. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg_qi.

Re: [RESEND PATCH 0/6] Enable CAAM on i.MX7s fix TrustZone issues

2018-01-25 Thread Horia Geantă
On 1/24/2018 4:50 PM, Bryan O'Donoghue wrote: > This patch-set enables CAAM on the i.MX7s and fixes a number of issues > identified with the CAAM driver and hardware when TrustZone mode is > enabled. > > The first block of patches are simple bug-fixes, followed by a second block > of patches

Re: [RESEND PATCH 1/6] crypto: caam: Fix null dereference at error path

2018-01-25 Thread Horia Geantă
Harkin <ryan.har...@linaro.org> > Signed-off-by: Rui Miguel Silva <rui.si...@linaro.org> > Cc: "Horia Geantă" <horia.gea...@nxp.com> > Cc: Aymen Sghaier <aymen.sgha...@nxp.com> > Cc: Fabio Estevam <fabio.este...@nxp.com> > Cc: Peng Fan <peng

Re: [PATCH v10 7/8] crypto: caam: cleanup CONFIG_64BIT ifdefs when using io{read|write}64

2018-01-05 Thread Horia Geantă
an Gunthorpe <log...@deltatee.com> > Cc: Andy Shevchenko <andy.shevche...@gmail.com> > Cc: Horia Geantă <horia.gea...@nxp.com> > Cc: Dan Douglass <dan.dougl...@nxp.com> > Cc: Herbert Xu <herb...@gondor.apana.org.au> > Cc: "David S. Miller" <da...@davemloft.net> Reviewed-by: Horia Geantă <horia.gea...@nxp.com> Thanks, Horia

Re: [PATCH v9 7/8] crypto: caam: cleanup CONFIG_64BIT ifdefs when using io{read|write}64

2018-01-03 Thread Horia Geantă
Shevchenko <andy.shevche...@gmail.com> > Cc: Horia Geantă <horia.gea...@nxp.com> > Cc: Dan Douglass <dan.dougl...@nxp.com> > Cc: Herbert Xu <herb...@gondor.apana.org.au> > Cc: "David S. Miller" <da...@davemloft.net> > --- > drivers/crypto

[PATCH v2 3/4] crypto: caam - save Era in driver's private data

2017-12-19 Thread Horia Geantă
Save Era in driver's private data for further usage, like deciding whether an erratum applies or a feature is available based on its value. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/ctrl.c | 4 +++- drivers/crypto/caam/intern.h | 1 + 2 files chan

[PATCH v2 4/4] crypto: caam - add Derived Key Protocol (DKP) support

2017-12-19 Thread Horia Geantă
in descriptor - descriptor buffer mapping changes -key is referenced - key buffer mapping changes Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- v2: fix DMA mapping direction for buffers holding the split key drivers/crypto/caam/caamalg.c | 112 --- drivers/crypt

[PATCH v2 1/4] crypto: caam - constify key data

2017-12-19 Thread Horia Geantă
Key data is not modified, it is copied in the shared descriptor. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg_desc.c | 6 +++--- drivers/crypto/caam/desc_constr.h | 10 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/d

[PATCH v2 2/4] crypto: caam - remove needless ablkcipher key copy

2017-12-19 Thread Horia Geantă
ablkcipher shared descriptors are relatively small, thus there is enough space for the key to be inlined. Accordingly, there is no need to copy the key in ctx->key. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c| 8 ++-- drivers/cr

Re: [PATCH 00/18] crypto: talitos - fixes and performance improvement

2017-12-08 Thread Horia Geantă
On 10/12/2017 6:20 PM, Herbert Xu wrote: > On Fri, Oct 06, 2017 at 03:04:31PM +0200, Christophe Leroy wrote: >> This serie fixes and improves the talitos crypto driver. >> >> First 6 patchs are fixes of failures reported by the new tests in the >> kernel crypto test manager. >> Looks like these

[PATCH 4.9-stable] Revert "crypto: caam - get rid of tasklet"

2017-12-05 Thread Horia Geantă
hreaded IRQs. [...] I think I've proven from the above that this patch needs to be reverted due to the performance regression, and that there _is_ most definitely a deterimental effect of switching from tasklets to threaded IRQs. [/quote] Signed-off-by: Horia Geantă <horia.gea...@nxp.

Re: [1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-29 Thread Horia Geantă
On 11/29/2017 8:28 AM, Herbert Xu wrote: > On Tue, Oct 10, 2017 at 01:21:59PM +0300, Robert Baronescu wrote: >> In case buffer length is a multiple of PAGE_SIZE, >> the S/G table is incorrectly generated. >> Fix this by handling buflen = k * PAGE_SIZE separately. >> >> Signed-off-by: Robert

[PATCH] crypto: caam/qi - use correct print specifier for size_t

2017-11-28 Thread Horia Geantă
)) ^ drivers/crypto/caam/caamalg_qi.c:1062:16: note: in expansion of macro CAAM_QI_MAX_ABLKCIPHER_SG qm_sg_ents, CAAM_QI_MAX_ABLKCIPHER_SG); ^ Fixes: eb9ba37dc15a ("crypto: caam/qi - handle large number of S/Gs case") Signed-off-by: Horia Geantă <horia.gea...@nxp.com&

Re: [PATCH 2/2] crypto: caam - add Derived Key Protocol (DKP) support

2017-11-23 Thread Horia Geantă
On 11/10/2017 4:34 PM, Horia Geantă wrote: > Offload split key generation in CAAM engine, using DKP. > DKP is supported starting with Era 6. > > Note that the way assoclen is transmitted from the job descriptor > to the shared descriptor changes - DPOVRD register is used instead &g

Re: [PATCH] crypto: tcrypt - set assoc in sg_init_aead()

2017-11-15 Thread Horia Geantă
On 11/14/2017 4:59 PM, Tudor Ambarus wrote: > Results better code readability. ^^ *in* better > > Signed-off-by: Tudor Ambarus <tudor.amba...@microchip.com> Reviewed-by: Horia Geantă <horia.gea...@nxp.com> Horia

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-14 Thread Horia Geantă
On 11/13/2017 8:28 PM, Tudor Ambarus wrote: > Hi, > > On 11/12/2017 06:26 PM, Horia Geantă wrote: > >> -sg[0] - (1 entry) reserved for associated data, filled outside >> sg_init_aead() > > Let's fill the sg[0] with aad inside sg_init_aead()! > This could be do

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-14 Thread Horia Geantă
On 11/13/2017 8:24 PM, Tudor Ambarus wrote: > Hi, > > On 10/10/2017 01:21 PM, Robert Baronescu wrote: >> In case buffer length is a multiple of PAGE_SIZE, >> the S/G table is incorrectly generated. >> Fix this by handling buflen = k * PAGE_SIZE separately. >> >> Signed-off-by: Robert Baronescu

Re: [PATCH RESEND 1/4] crypto: caam: add caam-dma node to SEC4.0 device tree binding

2017-11-13 Thread Horia Geantă
On 11/10/2017 6:44 PM, Kim Phillips wrote: > On Fri, 10 Nov 2017 08:02:01 + > Radu Andrei Alexe wrote: [snip]>> 2. I wanted this driver to be tracked by the dma engine team. They have >> the right expertise to provide adequate feedback. If all the code was in >> the

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-12 Thread Horia Geantă
On 11/10/2017 1:23 PM, Herbert Xu wrote: > On Fri, Nov 10, 2017 at 09:17:33AM +0000, Horia Geantă wrote: >> >>> I must be missing something. In the case rem == 0, let's say >>> the original value of np is npo. Then at the start of the loop, >>> np = npo - 1

[PATCH 2/2] crypto: caam - add Derived Key Protocol (DKP) support

2017-11-10 Thread Horia Geantă
registers. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamalg.c | 52 +-- drivers/crypto/caam/caamalg_desc.c | 176 ++--- drivers/crypto/caam/caamalg_desc.h | 10 +-- drivers/crypto/caam/caamalg_qi.c | 31 ++- d

[PATCH 1/2] crypto: caam - save Era in driver's private data

2017-11-10 Thread Horia Geantă
Save Era in driver's private data for further usage, like deciding whether an erratum applies or a feature is available based on its value. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/ctrl.c | 4 +++- drivers/crypto/caam/intern.h | 1 + 2 files chan

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-10 Thread Horia Geantă
On 11/10/2017 9:43 AM, Herbert Xu wrote: > On Fri, Nov 10, 2017 at 06:37:22AM +0000, Horia Geantă wrote: >> On 11/10/2017 12:21 AM, Herbert Xu wrote: >>> On Thu, Nov 09, 2017 at 02:37:29PM +, Horia Geantă wrote: >>>> >>>>>> sg_init_t

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-09 Thread Horia Geantă
On 11/10/2017 12:21 AM, Herbert Xu wrote: > On Thu, Nov 09, 2017 at 02:37:29PM +0000, Horia Geantă wrote: >> >>>>sg_init_table(sg, np + 1); >> sg_mark_end() marks sg[np]. >> >>>> - np--; >>>> + if (rem) >>>> + np-

Re: [PATCH 1/2] crypto: tcrypt - fix S/G table for test_aead_speed()

2017-11-09 Thread Horia Geantă
On 11/3/2017 2:42 PM, Herbert Xu wrote: > On Tue, Oct 10, 2017 at 01:21:59PM +0300, Robert Baronescu wrote: >> In case buffer length is a multiple of PAGE_SIZE, >> the S/G table is incorrectly generated. >> Fix this by handling buflen = k * PAGE_SIZE separately. >> >> Signed-off-by: Robert

Re: [PATCH v2 1/3] staging: ccree: copy IV to DMAable memory

2017-11-08 Thread Horia Geantă
On 11/2/2017 10:14 AM, Gilad Ben-Yossef wrote: > We are being passed an IV buffer from unknown origin, which may be > stack allocated and thus not safe for DMA. Allocate a DMA safe > buffer for the IV and use that instead. > IIUC this fixes only the (a)blkcipher / skcipher algorithms. What about

[PATCH 2/2] crypto: caam - remove unused param of ctx_map_to_sec4_sg()

2017-11-01 Thread Horia Geantă
ctx_map_to_sec4_sg() function, added in commit 045e36780f115 ("crypto: caam - ahash hmac support") has never used the "desc" parameter, so let's drop it. Signed-off-by: Horia Geantă <horia.gea...@nxp.com> --- drivers/crypto/caam/caamhash.c | 8 1 file c

[PATCH 1/2] crypto: caam - remove unneeded edesc zeroization

2017-11-01 Thread Horia Geantă
Extended descriptor allocation has been changed by commit dde20ae9d6383 ("crypto: caam - Change kmalloc to kzalloc to avoid residual data") to provide zeroized memory, meaning we no longer have to sanitize its members - edesc->src_nents and edesc->dst_dma. Signed-off-by: Horia G

Re: [PATCH] crypto: testmgr: don't allocate IV on stack

2017-10-31 Thread Horia Geantă
On 10/31/2017 10:00 AM, Herbert Xu wrote: > On Tue, Oct 31, 2017 at 07:56:26AM +, Gilad Ben-Yossef wrote: >> The IV was allocated on the stack in testmgr skcipher tests. >> Since HW based tfm providers need to DMA the IV to the HW, >> this leads to problems and is detected by the DMA-API debug

[PATCH RESEND 3/4] crypto: caam: add functionality used by the caam_dma driver

2017-10-30 Thread Horia Geantă
From: Radu Alexe The caam_dma is a memcpy DMA driver based on the DMA functionality of the CAAM hardware block. It creates a DMA channel for each JR of the CAAM. This patch adds functionality that is used by the caam_dma that is not yet part of the JR driver. Signed-off-by:

[PATCH RESEND 4/4] dma: caam: add dma memcpy driver

2017-10-30 Thread Horia Geantă
From: Radu Alexe This module introduces a memcpy DMA driver based on the DMA capabilities of the CAAM hardware block. CAAM DMA is a platform driver that is only probed if the device is defined in the device tree. The driver creates a DMA channel for each JR of the CAAM. This

[PATCH RESEND 2/4] arm64: dts: ls1012a: add caam-dma node

2017-10-30 Thread Horia Geantă
From: Radu Alexe Signed-off-by: Radu Alexe --- arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi index

[PATCH RESEND 1/4] crypto: caam: add caam-dma node to SEC4.0 device tree binding

2017-10-30 Thread Horia Geantă
From: Radu Alexe Signed-off-by: Radu Alexe --- .../devicetree/bindings/crypto/fsl-sec4.txt | 21 + 1 file changed, 21 insertions(+) diff --git a/Documentation/devicetree/bindings/crypto/fsl-sec4.txt

[PATCH RESEND 0/4] add CAAM DMA memcpy driver

2017-10-30 Thread Horia Geantă
From: Radu Alexe This patch-set introduces a new DMA memcpy driver based on the DMA capabilities of the CAAM crypto engine. Because of this dependency the included commits target various parts of the kernel tree. Patch 1. Since the CAAM DMA driver is a platform driver it is

  1   2   3   4   >