Re: [PATCH 2/2] crypto: qat - Don't move data inside output buffer

2015-08-13 Thread Herbert Xu
On Thu, Aug 13, 2015 at 11:14:11PM -0700, Tadeusz Struk wrote: > > Right, but we don't need that anymore. Why not? If you reduce the size without moving the buffer wouldn't it begin with a bunch of zeroes and wouldn't you lose the real bytes at the end? Cheers, -- Email: Herbert Xu Home Page:

Re: [PATCH 2/2] crypto: qat - Don't move data inside output buffer

2015-08-13 Thread Tadeusz Struk
On 08/13/2015 10:14 PM, Herbert Xu wrote: >> diff --git a/drivers/crypto/qat/qat_common/qat_asym_algs.c >> b/drivers/crypto/qat/qat_common/qat_asym_algs.c >> > index fe352a6..6ddb13c 100644 >> > --- a/drivers/crypto/qat/qat_common/qat_asym_algs.c >> > +++ b/drivers/crypto/qat/qat_common/qat_asym_a

Re: [PATCH 2/2] crypto: qat - Don't move data inside output buffer

2015-08-13 Thread Herbert Xu
On Wed, Aug 12, 2015 at 08:54:45PM -0700, Tadeusz Struk wrote: > Don't need to move data inside of the output buffer > because SW doen't need to do this anymore sice the new MPI > mpi_read_buf() has been added. Just set the correct output len. > > Signed-off-by: Tadeusz Struk > --- > drivers/cry

[PATCH v2] crypto: amcc: Do a NULL check for pointer

2015-08-13 Thread Fabio Estevam
From: Fabio Estevam Compare pointer-typed values to NULL rather than 0. The semantic patch that makes this change is available in scripts/coccinelle/null/badzero.cocci Signed-off-by: Fabio Estevam --- Changes since v1: - Use !core_dev->dev->ce_base drivers/crypto/amcc/crypto4xx_core.c | 2 +-

Re: [PATCH] crypto: amcc: Do a NULL check for pointer

2015-08-13 Thread Herbert Xu
On Fri, Aug 14, 2015 at 12:05:58AM -0300, Fabio Estevam wrote: > From: Fabio Estevam > > Compare pointer-typed values to NULL rather than 0. > > The semantic patch that makes this change is available > in scripts/coccinelle/null/badzero.cocci > > Signed-off-by: Fabio Estevam > --- > drivers/c

[PATCH] crypto: amcc: Do a NULL check for pointer

2015-08-13 Thread Fabio Estevam
From: Fabio Estevam Compare pointer-typed values to NULL rather than 0. The semantic patch that makes this change is available in scripts/coccinelle/null/badzero.cocci Signed-off-by: Fabio Estevam --- drivers/crypto/amcc/crypto4xx_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH 1/2] crypto: KEYS: convert public key to the akcipher API

2015-08-13 Thread Herbert Xu
On Thu, Aug 13, 2015 at 03:23:16PM +0100, David Howells wrote: > > > - /* Decode the public key */ > > - ret = asn1_ber_decoder(&x509_rsakey_decoder, ctx, > > - ctx->key, ctx->key_size); > > - if (ret < 0) > > + cert->pub->key = kmemdup(ctx->key, ctx->key_size, GFP

Re: [PATCH 1/2] crypto: KEYS: convert public key to the akcipher API

2015-08-13 Thread Tadeusz Struk
On 08/13/2015 07:23 AM, David Howells wrote: > Tadeusz Struk wrote: > >> const char *const pkey_algo_name[PKEY_ALGO__LAST] = { >> -[PKEY_ALGO_DSA] = "DSA", >> -[PKEY_ALGO_RSA] = "RSA", >> +[PKEY_ALGO_DSA] = "dsa", >> +[PKEY_ALGO_RSA] = "rsa", >> }

Re: [PATCH 0/2] crypto: KEYS: convert public key to the akcipher API

2015-08-13 Thread Tadeusz Struk
On 08/13/2015 06:56 AM, David Howells wrote: > Can you rebase this on top of: > > > http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=modsign-pkcs7 > > David > Will do. -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message

Re: [PATCH 2/2] crypto: qat - Don't move data inside output buffer

2015-08-13 Thread Tadeusz Struk
On 08/12/2015 08:54 PM, Tadeusz Struk wrote: > Don't need to move data inside of the output buffer > because SW doen't need to do this anymore sice the new MPI > mpi_read_buf() has been added. Just set the correct output len. > > Signed-off-by: Tadeusz Struk > --- > drivers/crypto/qat/qat_common

Re: [PATCH 1/2] crypto: KEYS: convert public key to the akcipher API

2015-08-13 Thread David Howells
Tadeusz Struk wrote: > const char *const pkey_algo_name[PKEY_ALGO__LAST] = { > - [PKEY_ALGO_DSA] = "DSA", > - [PKEY_ALGO_RSA] = "RSA", > + [PKEY_ALGO_DSA] = "dsa", > + [PKEY_ALGO_RSA] = "rsa", > }; Be aware that these are exposed to userspace thr

Re: [PATCH 0/2] crypto: KEYS: convert public key to the akcipher API

2015-08-13 Thread David Howells
Can you rebase this on top of: http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=modsign-pkcs7 David -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.ker

[PATCH 12/13] crypto: aead - Remove old AEAD interfaces

2015-08-13 Thread Herbert Xu
Now that the AEAD conversion is complete we can rip out the old AEAD interafce and associated code. Signed-off-by: Herbert Xu --- crypto/aead.c | 606 include/crypto/aead.h | 146 - include/crypto/internal/aead.h |

[PATCH 11/13] crypto: qat - Remove reference to crypto_aead_crt

2015-08-13 Thread Herbert Xu
The qat driver uses crypto_aead_crt in order to get the authsize. This patch replaces it with the crypto_aead_authsize helper instead. Signed-off-by: Herbert Xu --- drivers/crypto/qat/qat_common/qat_algs.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/cryp

[PATCH 6/13] crypto: echainiv - Remove AEAD compatibility code

2015-08-13 Thread Herbert Xu
Now that we no longer have any legacy AEAD implementations the compatibility code path can no longer be triggered. This patch removes it. Signed-off-by: Herbert Xu --- crypto/echainiv.c |4 1 file changed, 4 deletions(-) diff --git a/crypto/echainiv.c b/crypto/echainiv.c index d3896c

[PATCH 8/13] crypto: seqiv - Use generic geniv init/exit helpers

2015-08-13 Thread Herbert Xu
This patch replaces the seqiv init/exit handlers with the generic geniv helpers. Signed-off-by: Herbert Xu --- crypto/seqiv.c | 75 + 1 file changed, 7 insertions(+), 68 deletions(-) diff --git a/crypto/seqiv.c b/crypto/seqiv.c index 3d

[PATCH 9/13] crypto: echainiv - Use generic geniv init/exit helpers

2015-08-13 Thread Herbert Xu
This patch replaces the echainiv init/exit handlers with the generic geniv helpers. Signed-off-by: Herbert Xu --- crypto/echainiv.c | 70 +- 1 file changed, 7 insertions(+), 63 deletions(-) diff --git a/crypto/echainiv.c b/crypto/echainiv.c

[PATCH 5/13] crypto: seqiv - Remove AEAD compatibility code

2015-08-13 Thread Herbert Xu
Now that we no longer have any legacy AEAD implementations the compatibility code path can no longer be triggered. This patch removes it. Signed-off-by: Herbert Xu --- crypto/seqiv.c | 127 - 1 file changed, 127 deletions(-) diff --git

[PATCH 3/13] ipsec: Replace seqniv with seqiv

2015-08-13 Thread Herbert Xu
Now that seqniv is identical with seqiv we no longer need it. Signed-off-by: Herbert Xu --- net/xfrm/xfrm_algo.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c index 42f7c76..f07224d 100644 --- a/net/xfrm/xfrm_alg

[PATCH 13/13] crypto: aead - Remove CRYPTO_ALG_AEAD_NEW flag

2015-08-13 Thread Herbert Xu
This patch removes the CRYPTO_ALG_AEAD_NEW flag now that everyone has been converted. Signed-off-by: Herbert Xu --- arch/arm64/crypto/aes-ce-ccm-glue.c |1 - arch/x86/crypto/aesni-intel_glue.c |3 +-- crypto/aead.c|6 ++ crypto/algif_aead.c

[PATCH 10/13] crypto: cryptd - Remove reference to crypto_aead_crt

2015-08-13 Thread Herbert Xu
Pretty soon the crypto_aead encrypt/decrypt hooks will disappear as they are now always identical to those in struct aead_alg. This patch replaces the references to these hooks with the ones from aead_alg instead. Signed-off-by: Herbert Xu --- crypto/cryptd.c |4 ++-- 1 file changed, 2 ins

[PATCH 1/13] crypto: algboss - Remove reference to nivaead

2015-08-13 Thread Herbert Xu
This patch removes a legacy reference to nivaead which is no longer used. Signed-off-by: Herbert Xu --- crypto/algboss.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/crypto/algboss.c b/crypto/algboss.c index 76fc0b2..6e39d9c 100644 --- a/crypto/algboss.c ++

[PATCH 2/13] crypto: user - Remove crypto_lookup_aead call

2015-08-13 Thread Herbert Xu
As IV generators are now standalone AEAD transforms, we no longer need to use the crypto_lookup_aead call. Signed-off-by: Herbert Xu --- crypto/crypto_user.c | 32 1 file changed, 32 deletions(-) diff --git a/crypto/crypto_user.c b/crypto/crypto_user.c index

[PATCH 7/13] crypto: aead - Add type-safe geniv init/exit helpers

2015-08-13 Thread Herbert Xu
This patch adds the helpers aead_init_geniv and aead_exit_geniv which are type-safe and intended the replace the existing geniv init/exit helpers. Signed-off-by: Herbert Xu --- crypto/Kconfig | 11 +--- crypto/aead.c | 55 ++

[PATCH 4/13] crypto: seqiv - Remove seqniv

2015-08-13 Thread Herbert Xu
Now that IPsec no longer uses seqniv we can remove it. Signed-off-by: Herbert Xu --- crypto/seqiv.c | 245 - 1 file changed, 1 insertion(+), 244 deletions(-) diff --git a/crypto/seqiv.c b/crypto/seqiv.c index 45d0563..debf8d3 100644 ---

[PATCH 0/13] crypto: aead - Complete AEAD conversion

2015-08-13 Thread Herbert Xu
Hi: This series completes the AEAD type conversion by updating some small leftovers and then ripping out the old AEAD interface as well as the temporary CRYPTO_ALG_AEAD_NEW flag. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~he

Re: [PATCH 1/2] crypto: export crypto_alg_list and rwsem

2015-08-13 Thread Joonsoo Kim
On Thu, Aug 13, 2015 at 03:29:18PM +0800, Herbert Xu wrote: > On Thu, Aug 13, 2015 at 04:30:31PM +0900, Joonsoo Kim wrote: > > > > How about introducing new functions to search supported algorithm in > > kernel-side? As crypto API is used in more places, this interface > > would be requested more.

Re: [PATCH 2/2] zram: use crypto API to compress the page

2015-08-13 Thread Joonsoo Kim
On Thu, Aug 13, 2015 at 03:32:33PM +0800, Herbert Xu wrote: > On Thu, Aug 13, 2015 at 04:19:41PM +0900, Joonsoo Kim wrote: > > > > If that optimization is really needed for the case that doesn't need > > tfm except fetching function pointer, we can implement sharable tfm > > in crypto subsystem. >

Re: [PATCH 2/2] zram: use crypto API to compress the page

2015-08-13 Thread Herbert Xu
On Thu, Aug 13, 2015 at 04:19:41PM +0900, Joonsoo Kim wrote: > > If that optimization is really needed for the case that doesn't need > tfm except fetching function pointer, we can implement sharable tfm > in crypto subsystem. I'm happy to consider changes to the crypto compression interface as l

Re: [PATCH 1/2] crypto: export crypto_alg_list and rwsem

2015-08-13 Thread Herbert Xu
On Thu, Aug 13, 2015 at 04:30:31PM +0900, Joonsoo Kim wrote: > > How about introducing new functions to search supported algorithm in > kernel-side? As crypto API is used in more places, this interface > would be requested more. Defined list weaken the advantage of strong > point of generic crypto

Re: [PATCH 1/2] crypto: export crypto_alg_list and rwsem

2015-08-13 Thread Joonsoo Kim
On Thu, Aug 13, 2015 at 02:38:23PM +0800, Herbert Xu wrote: > On Thu, Aug 13, 2015 at 03:37:55PM +0900, Joonsoo Kim wrote: > > > > Is there any way to access netlink interface and get the output from > > kernel-side? I'd like to show information through > > "/sys/block/zramX/comp_algorithm", becaus

Re: [PATCH] crypto: caam - Fix error handling in caam_rng_init()

2015-08-13 Thread Herbert Xu
On Wed, Aug 12, 2015 at 11:48:42AM -0300, Fabio Estevam wrote: > From: Fabio Estevam > > In the error paths we should free the resources that were > previously acquired, so fix it accordingly. > > Signed-off-by: Fabio Estevam Applied. -- Email: Herbert Xu Home Page: http://gondor.apana.org.

Re: [PATCH] crypto: caam - Remove unneeded 'ret' variable

2015-08-13 Thread Herbert Xu
On Wed, Aug 12, 2015 at 02:39:38PM -0300, Fabio Estevam wrote: > From: Fabio Estevam > > Variable 'ret' is only used for returning the value 0. > > We can make it simpler and just return 0 instead. > > The semantic patch that makes this change is available > in scripts/coccinelle/misc/returnvar

Re: [cryptodev:master 119/123] warning: (CRYPTO_DEV_QAT_DH895xCCVF) selects PCI_IOV which has unmet direct dependencies (PCI)

2015-08-13 Thread Herbert Xu
On Tue, Aug 11, 2015 at 11:05:37AM -0700, Tadeusz Struk wrote: > > ---8<--- > Fix unmet direct dependencies for QAT_DH895xCCVF > > Reported-by: Fengguang Wu > Signed-off-by: Tadeusz Struk Applied. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apan

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

2015-08-13 Thread Herbert Xu
On Wed, Aug 12, 2015 at 12:50:17PM +0800, kbuild test robot wrote: > drivers/crypto/qat/qat_common/adf_sriov.c:258:1-4: WARNING: end returns can > be simpified and declaration on line 212 can be dropped > > Simplify a trivial if-return sequence. Possibly combine with a > preceding function cal

Re: [PATCH 0/3] ARM: sun6i: Support Security System crypto engine

2015-08-13 Thread Herbert Xu
On Tue, Aug 11, 2015 at 01:32:54PM +0800, Chen-Yu Tsai wrote: > Hi everyone, > > This series enables support for the crypto engine found in sun6i, or > Allwinner A31/A31s SoCs. The crypto engine is the same hardware as on > earlier sun4i/sun7i (A10/A20), with the only difference being the reset >

Re: [PATCH 2/2] zram: use crypto API to compress the page

2015-08-13 Thread Joonsoo Kim
On Thu, Aug 13, 2015 at 12:51:13PM +0900, Sergey Senozhatsky wrote: > On (08/13/15 11:24), Joonsoo Kim wrote: > > 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 nee

Re: [PATCH] crypto: caam - fix memory corruption in ahash_final_ctx

2015-08-13 Thread Herbert Xu
On Tue, Aug 11, 2015 at 08:19:20PM +0300, Horia Geantă wrote: > When doing pointer operation for accessing the HW S/G table, > a value representing number of entries (and not number of bytes) > must be used. > > Cc: # 3.6+ > Fixes: 045e36780f115 ("crypto: caam - ahash hmac support") > Signed-off-