Re: [PATCH v3] crypto/caam: add backlogging support

2015-09-21 Thread Horia Geantă
On 9/19/2015 12:02 PM, Alex Porosanu wrote: > caam_jr_enqueue() function returns -EBUSY once there are no > more slots available in the JR, but it doesn't actually save > the current request. This breaks the functionality of users > that expect that even if there is no more space for the request,

Re: [PATCH v3 1/9] crypto: introduce decompression API that can be called via sharable tfm object

2015-09-21 Thread Sergey Senozhatsky
On (09/18/15 14:19), Joonsoo Kim wrote: [..] > static int __init lzo_mod_init(void) > diff --git a/include/linux/crypto.h b/include/linux/crypto.h > index e71cb70..31152b1 100644 > --- a/include/linux/crypto.h > +++ b/include/linux/crypto.h > @@ -355,6 +355,8 @@ struct compress_alg { >

Re: [PATCH v3 9/9] zram: use crypto decompress_noctx API

2015-09-21 Thread Sergey Senozhatsky
On (09/18/15 14:19), Joonsoo Kim wrote: [..] > + /* > + * Prepare to use crypto decompress_noctx API. One tfm is required > + * to initialize crypto algorithm properly and fetch corresponding > + * function pointer. But, it is sharable for multiple concurrent > + *

[PATCH 10/38] hwrng: fix handling platform_get_irq

2015-09-21 Thread Andrzej Hajda
The function can return negative value. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda ---

Re: [RFC][PATCH 0/9] use CRYPTO_ALG_TFM_MAY_SHARE cra flag (full patchset)

2015-09-21 Thread Sergey Senozhatsky
On (09/21/15 22:13), Sergey Senozhatsky wrote: > RFC > > resend reason: > git (2.6.0-rc2) has crashed and spme patches were not sent out. > > > Sorry for the noise. > > === what a day... really sorry. (release 2.5.3) git has crashed again [Net::SMTP::SSL] Connection closed

Re: [PATCH 00/38] Fixes related to incorrect usage of unsigned types

2015-09-21 Thread David Howells
Andrzej Hajda wrote: > Semantic patch finds comparisons of types: > unsigned < 0 > unsigned >= 0 > The former is always false, the latter is always true. > Such comparisons are useless, so theoretically they could be > safely removed, but their presence quite often

[RFC][PATCH 1/9] crypto: introduce CRYPTO_ALG_TFM_MAY_SHARE flag

2015-09-21 Thread Sergey Senozhatsky
Set CRYPTO_ALG_TFM_MAY_SHARE ->cra_flags when algorithm support shared tfm. Signed-off-by: Sergey Senozhatsky --- include/linux/crypto.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/linux/crypto.h b/include/linux/crypto.h index

[RFC][PATCH 6/9] zram: make stream find and release functions static

2015-09-21 Thread Sergey Senozhatsky
Hide (make static) zstrm find and release function and introduce zcomp_compress_begin()/zcomp_compress_end(). We will have begin and end functions around compression (this patch) and decompression (next patch). So the work flow is evolving to: zstrm = foo_begin(); foo(zstrm);

[RFC][PATCH 5/9] crypto/842: set CRYPTO_ALG_TFM_MAY_SHARE

2015-09-21 Thread Sergey Senozhatsky
Signed-off-by: Sergey Senozhatsky --- crypto/842.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/842.c b/crypto/842.c index 98e387e..579be68 100644 --- a/crypto/842.c +++ b/crypto/842.c @@ -56,7 +56,8 @@ static struct crypto_alg alg =

[RFC][PATCH 0/9] use CRYPTO_ALG_TFM_MAY_SHARE cra flag (full patchset)

2015-09-21 Thread Sergey Senozhatsky
RFC resend reason: git (2.6.0-rc2) has crashed and spme patches were not sent out. Sorry for the noise. === This patch set implements a bit different approach to shared tfm. It defines a new CRYPTO_ALG_TFM_MAY_SHARE ->cra_flag which each algorithm setups in its `static struct

[RFC][PATCH 2/9] crypto/lzo: set CRYPTO_ALG_TFM_MAY_SHARE

2015-09-21 Thread Sergey Senozhatsky
Signed-off-by: Sergey Senozhatsky --- crypto/lzo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/lzo.c b/crypto/lzo.c index 4b3e925..994667e 100644 --- a/crypto/lzo.c +++ b/crypto/lzo.c @@ -82,7 +82,8 @@ static int

[RFC][PATCH 3/9] crypto/lz4: set CRYPTO_ALG_TFM_MAY_SHARE

2015-09-21 Thread Sergey Senozhatsky
Signed-off-by: Sergey Senozhatsky --- crypto/lz4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/lz4.c b/crypto/lz4.c index aefbcea..ca48de1 100644 --- a/crypto/lz4.c +++ b/crypto/lz4.c @@ -78,7 +78,8 @@ static int

[RFC][PATCH 4/9] crypto/lz4hc: set CRYPTO_ALG_TFM_MAY_SHARE

2015-09-21 Thread Sergey Senozhatsky
Signed-off-by: Sergey Senozhatsky --- crypto/lz4hc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crypto/lz4hc.c b/crypto/lz4hc.c index a1d3b5b..34ef3de 100644 --- a/crypto/lz4hc.c +++ b/crypto/lz4hc.c @@ -78,7 +78,8 @@ static int

[RFC][PATCH 7/9] zram: pass zstrm down to decompression path

2015-09-21 Thread Sergey Senozhatsky
Introduce zcomp_decompress_begin()/zcomp_decompress_end() as a preparation for crypto API-powered zcomp. Change zcomp_decompress() signature to require zstrm parameter. Unlike zcomp_compress_begin(), zcomp_decompress_begin() may return zstrm if currently selected compression backend require

[PATCH v4] crypto/caam: add backlogging support

2015-09-21 Thread Alex Porosanu
caam_jr_enqueue() function returns -EBUSY once there are no more slots available in the JR, but it doesn't actually save the current request. This breaks the functionality of users that expect that even if there is no more space for the request, it is at least queued for later execution. In other

[RFC][PATCH 8/9] zram: use crypto API for compression

2015-09-21 Thread Sergey Senozhatsky
Until now, zram uses compression algorithm through direct call to core algorithm function, but, it has drawback that we need to add compression algorithm manually to zram if needed. Without this work, we cannot utilize various compression algorithms in the system. Moreover, to add new compression

[PATCH v2 2/2] crypto: akcipher - Changes to asymmetric key API

2015-09-21 Thread Tadeusz Struk
Setkey function has been split into set_priv_key and set_pub_key. Akcipher requests takes sgl for src and dst instead of void *. Users of the API i.e. two existing RSA implementation and test mgr code have been updated accordingly. Signed-off-by: Tadeusz Struk ---

[PATCH v2 1/2] lib/scatterlist: Add sg_len helper

2015-09-21 Thread Tadeusz Struk
Add sg_len function which returns the total number of bytes in sg. Signed-off-by: Tadeusz Struk --- include/linux/scatterlist.h |1 + lib/scatterlist.c | 18 ++ 2 files changed, 19 insertions(+) diff --git a/include/linux/scatterlist.h

[PATCH v2 0/2] crypto: akcipher - Changes to asymmetric key API

2015-09-21 Thread Tadeusz Struk
This series updates the asymmetric key API. The changes include - setkey function has been split into set_priv_key and set_pub_key. - akcipher requests takes sgl for src and dst instead of void *. Users of the API i.e. two existing RSA implementation and test mgr code have been updated

Re: [cryptodev:master 10/29] arch/x86/crypto/sha256_ssse3_glue.c:172:19: error: 'X86_FEATURE_SHA_NI' undeclared

2015-09-21 Thread Herbert Xu
On Mon, Sep 21, 2015 at 02:01:30PM -0700, Tim Chen wrote: > > Thanks. Will this patch series go in the 4.3 or 4.4 time frame? It's for 4.4. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key:

Re: [PATCH v2 1/2] lib/scatterlist: Add sg_len helper

2015-09-21 Thread Stephan Mueller
Am Montag, 21. September 2015, 16:44:14 schrieb Tadeusz Struk: Hi Tadeusz, >Add sg_len function which returns the total number of bytes in sg. > >Signed-off-by: Tadeusz Struk >--- > include/linux/scatterlist.h |1 + > lib/scatterlist.c | 18

Re: [PATCH] crypto: qat - VF should never trigger SBR on PH

2015-09-21 Thread Tadeusz Struk
On 09/21/2015 08:04 AM, Herbert Xu wrote: >> Don't allow to trigger SBR from a VF running in VMM context. >> > >> > Signed-off-by: Conor McLoughlin >> > Signed-off-by: Tadeusz Struk > Applied to crypto. Thanks Herbert. Actually it's only

Re: [PATCH] drivers/crypto/nx: Add CRC and validation support for nx842

2015-09-21 Thread Dan Streetman
On Mon, Sep 21, 2015 at 10:26 AM, Herbert Xu wrote: > On Sat, Sep 19, 2015 at 05:02:42PM -0700, Haren Myneni wrote: >> Hi, >> >> This patch allows nx842 coprocessor to add CRC for compression and >> check the computed CRC value for uncompression. Please let me know >>

Re: [PATCH] crypto: qat - VF should never trigger SBR on PH

2015-09-21 Thread Herbert Xu
On Fri, Sep 18, 2015 at 08:59:47AM -0700, Tadeusz Struk wrote: > From: Conor McLoughlin > > Don't allow to trigger SBR from a VF running in VMM context. > > Signed-off-by: Conor McLoughlin > Signed-off-by: Tadeusz Struk

Re: [PATCH] crypto: crc32c-pclmul: use .rodata instead of .rotata

2015-09-21 Thread Herbert Xu
On Sun, Sep 20, 2015 at 04:42:36PM +0200, Nicolas Iooss wrote: > Module crc32c-intel uses a special read-only data section named .rotata. > This section is defined for K_table, and its name seems to be a spelling > mistake for .rodata. > > Fixes: 473946e674eb ("crypto: crc32c-pclmul - Shrink

Re: [PATCH 10/38] hwrng: fix handling platform_get_irq

2015-09-21 Thread Herbert Xu
On Mon, Sep 21, 2015 at 03:33:42PM +0200, Andrzej Hajda wrote: > The function can return negative value. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. > > [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576

Re: [PATCH] crypto: marvell: properly handle CRYPTO_TFM_REQ_MAY_BACKLOG-flagged requests

2015-09-21 Thread Herbert Xu
On Fri, Sep 18, 2015 at 05:25:36PM +0200, Thomas Petazzoni wrote: > The mv_cesa_queue_req() function calls crypto_enqueue_request() to > enqueue a request. In the normal case (i.e the queue isn't full), this > function returns -EINPROGRESS. The current Marvell CESA crypto driver > takes this into

Re: [PATCH v2] crypto: Remove duplicate code of SG helpers functions

2015-09-21 Thread Herbert Xu
On Fri, Sep 18, 2015 at 02:57:08PM +0200, LABBE Corentin wrote: > Hello > > This patch series try to remove some duplicate code of some SG helpers > functions. > The first four patch replace custom functions by already in-tree helper > functions. Patches 1-3 applied. Patch 4 should go through

Re: [PATCH v2 5/8] lib: introduce sg_nents_len_chained

2015-09-21 Thread Herbert Xu
On Fri, Sep 18, 2015 at 05:25:47PM -0400, Tony Battersby wrote: > > So instead of adding a new function sg_nents_len_chained(), a better > cleanup would be: > 1) replace the driver-specific functions with calls to sg_nents_for_len() > 2) get rid of the "chained" variables > 3) always call

Re: [PATCH v2 5/8] lib: introduce sg_nents_len_chained

2015-09-21 Thread LABBE Corentin
On Mon, Sep 21, 2015 at 10:19:17PM +0800, Herbert Xu wrote: > On Fri, Sep 18, 2015 at 05:25:47PM -0400, Tony Battersby wrote: > > > > So instead of adding a new function sg_nents_len_chained(), a better > > cleanup would be: > > 1) replace the driver-specific functions with calls to

Re: [PATCH] drivers/crypto/nx: Add CRC and validation support for nx842

2015-09-21 Thread Herbert Xu
On Sat, Sep 19, 2015 at 05:02:42PM -0700, Haren Myneni wrote: > Hi, > > This patch allows nx842 coprocessor to add CRC for compression and > check the computed CRC value for uncompression. Please let me know > if you have any comments. > > Thanks > Haren > > commit

Re: [cryptodev:master 10/29] arch/x86/crypto/sha256_ssse3_glue.c:172:19: error: 'X86_FEATURE_SHA_NI' undeclared

2015-09-21 Thread Herbert Xu
Hi Tim: On Fri, Sep 18, 2015 at 09:12:01AM -0700, Tim Chen wrote: > > It seems like Thomas has already merged the cpu id patch upstream. > http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/commit/?id=488ca7d72d974e3c00ae73ed9f947590680bdf00 > > Can you merge that patch into cryptodev and

[RFC][PATCH 9/9] zram: use crypto CRYPTO_ALG_TFM_MAY_SHARE API

2015-09-21 Thread Sergey Senozhatsky
Crypto subsystem now supports CRYPTO_ALG_TFM_MAY_SHARE API that requires special tfm_noctx. This tfm can be shared by multiple concurrent decompress user because this API doesn't rely on this tfm object except to fetch decompress function pointer. Until changing to use crypto API, zram doesn't

[PATCH v3 0/3] SP800-38F / RFC3394 key wrapping

2015-09-21 Thread Stephan Mueller
Hi, note, patch 3 is dependent on patch https://lkml.org/lkml/2015/6/16/342 Changes v3: * split patch for easier review * add support for full SGL handling in decrypt by adding a "fast-forward" function * significant simplification of code and removal of one memcpy per round * use of scatterwalk

[PATCH v3 2/3] crypto: keywrap - enable compilation

2015-09-21 Thread Stephan Mueller
Hook keywrap source code into Kconfig and Makefile Signed-off-by: Stephan Mueller --- crypto/Kconfig | 7 +++ crypto/Makefile | 1 + 2 files changed, 8 insertions(+) diff --git a/crypto/Kconfig b/crypto/Kconfig index fc93444..7240821 100644 --- a/crypto/Kconfig +++

[PATCH v3 3/3] crypto: keywrap - add testmgr support

2015-09-21 Thread Stephan Mueller
The testmanager code for symmetric ciphers is extended to allow verification of the IV after a cipher operation. In addition, test vectors for kw(aes) for encryption and decryption are added. Signed-off-by: Stephan Mueller --- crypto/testmgr.c | 16

[PATCH v3 1/3] crypto: add key wrapping block chaining mode

2015-09-21 Thread Stephan Mueller
This patch implements the AES key wrapping as specified in NIST SP800-38F and RFC3394. The implementation covers key wrapping without padding. IV handling: The caller does not provide an IV for encryption, but must obtain the IV after encryption which would serve as the first semblock in the

Re: [cryptodev:master 10/29] arch/x86/crypto/sha256_ssse3_glue.c:172:19: error: 'X86_FEATURE_SHA_NI' undeclared

2015-09-21 Thread Tim Chen
On Mon, 2015-09-21 at 22:02 +0800, Herbert Xu wrote: > Hi Tim: > > On Fri, Sep 18, 2015 at 09:12:01AM -0700, Tim Chen wrote: > > > > It seems like Thomas has already merged the cpu id patch upstream. > >

Re: [PATCH] crypto: marvell: properly handle CRYPTO_TFM_REQ_MAY_BACKLOG-flagged requests

2015-09-21 Thread Vincent Donnefort
Hi Thomas, Your patch fixes the problem on my side. Tested-by: Vincent Donnefort On Fri, Sep 18, 2015 at 05:25:36PM +0200, Thomas Petazzoni wrote: > The mv_cesa_queue_req() function calls crypto_enqueue_request() to > enqueue a request. In the normal case (i.e the queue