Re: [PATCH] crypto: crypto4xx - fix AES CTR blocksize value

2019-05-22 Thread Herbert Xu
On Fri, May 17, 2019 at 11:15:57PM +0200, Christian Lamparter wrote: > This patch fixes a issue with crypto4xx's ctr(aes) that was > discovered by libcapi's kcapi-enc-test.sh test. > > The some of the ctr(aes) encryptions test were failing on the > non-power-of-two test: > > kcapi-enc - Error: en

Re: [PATCH 1/2] crypto: crypto4xx - fix blocksize for cfb and ofb

2019-05-22 Thread Herbert Xu
On Sat, May 18, 2019 at 11:28:11PM +0200, Christian Lamparter wrote: > While the hardware consider them to be blockciphers, the > reference implementation defines them as streamciphers. > > Do the right thing and set the blocksize to 1. This > was found by CONFIG_CRYPTO_MANAGER_EXTRA_TESTS. > > T

Re: [PATCH] crypto: caam - print debugging hex dumps after unmapping

2019-05-22 Thread Herbert Xu
On Thu, May 16, 2019 at 04:24:42PM +0200, Sascha Hauer wrote: > For encryption the destination pointer was still mapped, so the hex dump > may be wrong. The IV still contained the input IV while printing instead > of the output IV as intended. > > For decryption the destination pointer was still m

Re: [PATCH 1/3] crypto: ccp - AES CFB mode is a stream cipher

2019-05-22 Thread Herbert Xu
On Tue, May 14, 2019 at 09:53:16PM +, Hook, Gary wrote: > CFB mode should be treated as a stream cipher, not block. > > Fixes: 63b945091a07 ('crypto: ccp - CCP device driver and interface support') > > Signed-off-by: Gary R Hook > --- > drivers/crypto/ccp/ccp-ops.c |6 +++--- > 1 file c

Re: [PATCH -next] arm/sha512 - Make sha512_arm_final static

2019-05-22 Thread Herbert Xu
On Sun, May 12, 2019 at 05:05:40PM +0800, YueHaibing wrote: > Fix sparse warning: > > arch/arm/crypto/sha512-glue.c:40:5: warning: > symbol 'sha512_arm_final' was not declared. Should it be static? > > Reported-by: Hulk Robot > Signed-off-by: YueHaibing > --- > arch/arm/crypto/sha512-glue.c |

Re: [PATCH] crypto: talitos - fix skcipher failure due to wrong output IV

2019-05-22 Thread Herbert Xu
On Wed, May 15, 2019 at 12:29:03PM +, Christophe Leroy wrote: > Selftests report the following: > > [2.984845] alg: skcipher: cbc-aes-talitos encryption test failed (wrong > output IV) on test vector 0, cfg="in-place" > [2.995377] : 3d af ba 42 9d 9e b4 30 b4 22 da 80 2c 9f ac

Re: [PATCH 1/7] crypto: qat - remove spin_lock in qat_ablkcipher_setkey

2019-05-22 Thread Herbert Xu
On Mon, Apr 29, 2019 at 04:43:15PM +0100, Giovanni Cabiddu wrote: > From: Xin Zeng > > Remove unnecessary spin lock in qat_ablkcipher_setkey. > > Reviewed-by: Conor Mcloughlin > Tested-by: Sergey Portnoy > Signed-off-by: Xin Zeng > Signed-off-by: Giovanni Cabiddu > --- > drivers/crypto/qat/

Re: [PATCH v2 0/7] crypto: caam - IOMMU support

2019-05-22 Thread Herbert Xu
On Fri, May 03, 2019 at 05:17:36PM +0300, Horia Geantă wrote: > This patch set adds support in caam drivers (caam/jr, caam/qi, caam/qi2) > for the crypto engine to work behind an IOMMU. > > v2: > Fixed compilation warnings (unused variables) in patch 3/7. > > v1: > > The changes consist in: > >

Re: [PATCH v6] crypto: DRBG - add FIPS 140-2 CTRNG for noise source

2019-05-22 Thread Herbert Xu
On Wed, May 08, 2019 at 04:19:24PM +0200, Stephan Mueller wrote: > FIPS 140-2 section 4.9.2 requires a continuous self test of the noise > source. Up to kernel 4.8 drivers/char/random.c provided this continuous > self test. Afterwards it was moved to a location that is inconsistent > with the FIPS

crypto: ixp4xx - Fix cross-compile errors due to type mismatch

2019-05-22 Thread Herbert Xu
This patch changes multiple uses of u32s to dma_addr_t where the physical address is used. This fixes COMPILE_TEST errors on 64-bit platforms. Signed-off-by: Herbert Xu diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index c99ba75caf3a..8db107f111dd 100644 --- a/dri

Re: [PATCH v2 1/2] crypto: caam - fix pkcs1pad(rsa-caam, sha256) failure because of invalid input

2019-05-22 Thread Herbert Xu
On Wed, May 15, 2019 at 02:25:45PM +0300, Iuliana Prodan wrote: > > @@ -1058,6 +1105,14 @@ static int __init caam_pkc_init(void) > goto out_put_dev; > } > > + /* allocate zero buffer, used for padding input */ > + zero_buffer = kzalloc(CAAM_RSA_MAX_INPUT_SIZE - 1, GFP_

Re: [PATCH] crypto: arm/sha512 - make function static

2019-05-22 Thread Herbert Xu
On Wed, May 22, 2019 at 10:07:14AM +, Philippe Mazenauer wrote: > Function sha512_arm_final() is only used in this file, therefore should > be static > > ../arch/arm/crypto/sha512-glue.c:40:5: warning: no previous prototype for > ‘sha512_arm_final’ [-Wmissing-prototypes] > int sha512_arm_fin

Re: [PATCH 0/2] hwrng: Support for 7211 in iproc-rng200

2019-05-22 Thread Herbert Xu
On Mon, May 20, 2019 at 03:49:12PM -0700, Florian Fainelli wrote: > On 5/10/19 10:31 AM, Florian Fainelli wrote: > > Hi Herbert, > > > > This patch series adds support for BCM7211 to the iproc-rng200 driver, > > nothing special besides matching the compatibile string and updating the > > binding d

Re: [PATCH v7 01/12] x86/crypto: Adapt assembly for PIE support

2019-05-22 Thread Eric Biggers
On Wed, May 22, 2019 at 01:47:07PM -0700, Thomas Garnier wrote: > On Mon, May 20, 2019 at 9:06 PM Eric Biggers wrote: > > > > On Mon, May 20, 2019 at 04:19:26PM -0700, Thomas Garnier wrote: > > > diff --git a/arch/x86/crypto/sha256-avx2-asm.S > > > b/arch/x86/crypto/sha256-avx2-asm.S > > > index

Re: [PATCH v7 01/12] x86/crypto: Adapt assembly for PIE support

2019-05-22 Thread Thomas Garnier
On Mon, May 20, 2019 at 9:06 PM Eric Biggers wrote: > > On Mon, May 20, 2019 at 04:19:26PM -0700, Thomas Garnier wrote: > > diff --git a/arch/x86/crypto/sha256-avx2-asm.S > > b/arch/x86/crypto/sha256-avx2-asm.S > > index 1420db15dcdd..2ced4b2f6c76 100644 > > --- a/arch/x86/crypto/sha256-avx2-asm.

[PATCH AUTOSEL 5.0 082/317] crypto: sun4i-ss - Fix invalid calculation of hash end

2019-05-22 Thread Sasha Levin
From: Corentin Labbe [ Upstream commit f87391558acf816b48f325a493d81d45dec40da0 ] When nbytes < 4, end is wronlgy set to a negative value which, due to uint, is then interpreted to a large value leading to a deadlock in the following code. This patch fix this problem. Fixes: 6298e948215f ("cry

[PATCH AUTOSEL 4.19 065/244] crypto: sun4i-ss - Fix invalid calculation of hash end

2019-05-22 Thread Sasha Levin
From: Corentin Labbe [ Upstream commit f87391558acf816b48f325a493d81d45dec40da0 ] When nbytes < 4, end is wronlgy set to a negative value which, due to uint, is then interpreted to a large value leading to a deadlock in the following code. This patch fix this problem. Fixes: 6298e948215f ("cry

[PATCH] crypto: hmac - fix memory leak in hmac_init_tfm()

2019-05-22 Thread Eric Biggers
From: Eric Biggers When I added the sanity check of 'descsize', I missed that the child hash tfm needs to be freed if the sanity check fails. Of course this should never happen, hence the use of WARN_ON(), but it should be fixed. Fixes: e1354400b25d ("crypto: hash - fix incorrect HASH_MAX_DESCS

[PATCH AUTOSEL 4.14 042/167] crypto: sun4i-ss - Fix invalid calculation of hash end

2019-05-22 Thread Sasha Levin
From: Corentin Labbe [ Upstream commit f87391558acf816b48f325a493d81d45dec40da0 ] When nbytes < 4, end is wronlgy set to a negative value which, due to uint, is then interpreted to a large value leading to a deadlock in the following code. This patch fix this problem. Fixes: 6298e948215f ("cry

[PATCH AUTOSEL 4.9 027/114] crypto: sun4i-ss - Fix invalid calculation of hash end

2019-05-22 Thread Sasha Levin
From: Corentin Labbe [ Upstream commit f87391558acf816b48f325a493d81d45dec40da0 ] When nbytes < 4, end is wronlgy set to a negative value which, due to uint, is then interpreted to a large value leading to a deadlock in the following code. This patch fix this problem. Fixes: 6298e948215f ("cry

[PATCH] crypto: arm/sha512 - make function static

2019-05-22 Thread Philippe Mazenauer
Function sha512_arm_final() is only used in this file, therefore should be static ../arch/arm/crypto/sha512-glue.c:40:5: warning: no previous prototype for ‘sha512_arm_final’ [-Wmissing-prototypes] int sha512_arm_final(struct shash_desc *desc, u8 *out) ^~~~ Signed-off-by: Phili

Re: [PATCH] crypto: jitterentropy - change back to module_init()

2019-05-22 Thread Geert Uytterhoeven
On Tue, May 21, 2019 at 8:46 PM Eric Biggers wrote: > From: Eric Biggers > > "jitterentropy_rng" doesn't have any other implementations, nor is it > tested by the crypto self-tests. So it was unnecessary to change it to > subsys_initcall. Also it depends on the main clocksource being > initiali