[PATCH v2 3/9] crypto: ixp4xx - Use IPAD/OPAD constant

2017-05-18 Thread Corentin Labbe
This patch simply replace all occurrence of HMAC IPAD/OPAD value by their define. Signed-off-by: Corentin Labbe --- drivers/crypto/ixp4xx_crypto.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 771dd26c7

[PATCH v2 4/9] crypto: marvell - Use IPAD/OPAD constant

2017-05-18 Thread Corentin Labbe
This patch simply replace all occurrence of HMAC IPAD/OPAD value by their define. Signed-off-by: Corentin Labbe --- drivers/crypto/marvell/hash.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/marvell/hash.c b/drivers/crypto/marvell/hash.c index 77c0fb936

[PATCH v2 5/9] crypto: mv_cesa - Use IPAD/OPAD constant

2017-05-18 Thread Corentin Labbe
This patch simply replace all occurrence of HMAC IPAD/OPAD value by their define. Signed-off-by: Corentin Labbe --- drivers/crypto/mv_cesa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c index 451fa18c1c7b..bf25f415ee

[PATCH v2 2/9] crypto: brcm - Use IPAD/OPAD constant

2017-05-18 Thread Corentin Labbe
This patch simply replace all occurrence of HMAC IPAD/OPAD value by their define. Signed-off-by: Corentin Labbe --- drivers/crypto/bcm/cipher.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c index cc0d5b98006e..6

[PATCH v2 0/9] crypto: add HMAC IPAD/OPAD constant

2017-05-18 Thread Corentin Labbe
Hello Many HMAC users directly use directly 0x36/0x5c values. It's better with crypto to use a name instead of directly some crypto constant. Changes since v1: - Moved constant to include/crypto/hmac.h - Added to includes Corentin Labbe (9): crypto: add hmac IPAD/OPAD constant crypto: brcm

[PATCH v2 9/9] crypto: ccp - Use IPAD/OPAD constant

2017-05-18 Thread Corentin Labbe
This patch simply replace all occurrence of HMAC IPAD/OPAD value by their define. Signed-off-by: Corentin Labbe --- drivers/crypto/ccp/ccp-crypto-sha.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sh

[PATCH v2 7/9] crypto: qat - Use IPAD/OPAD constant

2017-05-18 Thread Corentin Labbe
This patch simply replace all occurrence of HMAC IPAD/OPAD value by their define. Signed-off-by: Corentin Labbe --- drivers/crypto/qat/qat_common/qat_algs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/qat/qat_common/qat_algs.c b/drivers/crypto/qat/qat

[PATCH v2 6/9] crypto: omap-sham - Use IPAD/OPAD constant

2017-05-18 Thread Corentin Labbe
This patch simply replace all occurrence of HMAC IPAD/OPAD value by their define. Signed-off-by: Corentin Labbe --- drivers/crypto/omap-sham.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c index d0b16e5e4ee5..1864

[PATCH v2 8/9] crypto: mediatek - Use IPAD/OPAD constant

2017-05-18 Thread Corentin Labbe
This patch simply replace all occurrence of HMAC IPAD/OPAD value by their define. Signed-off-by: Corentin Labbe --- drivers/crypto/mediatek/mtk-sha.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/mediatek/mtk-sha.c b/drivers/crypto/mediatek/mtk-sha.c in

[PATCH v2 1/9] crypto: add hmac IPAD/OPAD constant

2017-05-18 Thread Corentin Labbe
Many HMAC users directly use directly 0x36/0x5c values. It's better with crypto to use a name instead of directly some crypto constant. This patch simply add HMAC_IPAD_VALUE/HMAC_OPAD_VALUE defines in a new include file "crypto/hmac.h" and use them in crypto/hmac.c Signed-off-by: Corentin Labbe

Re: [PATCH] crypto: x86/aes - Don't use %rbp as temporary register

2017-05-18 Thread Eric Biggers
On Thu, May 18, 2017 at 08:56:32PM -0500, Josh Poimboeuf wrote: > > > > Hmm, it looks like a number of other algorithms in arch/x86/crypto/ use > > %rbp (or > > %ebp), e.g. blowfish, camellia, cast5, and aes-i586. Presumably they have > > the > > same problem. I'm a little confused: do these a

Re: [PATCH] crypto: x86/aes - Don't use %rbp as temporary register

2017-05-18 Thread Josh Poimboeuf
On Wed, May 17, 2017 at 03:21:41PM -0700, Eric Biggers wrote: > On Wed, May 17, 2017 at 03:44:27PM -0500, Josh Poimboeuf wrote: > > On Tue, May 16, 2017 at 09:03:08PM -0700, Eric Biggers wrote: > > > From: Eric Biggers > > > > > > When using the "aes-asm" implementation of AES (*not* the AES-NI >

[PATCH 00/31] Standardize doc formats - part 1

2017-05-18 Thread Mauro Carvalho Chehab
Each document under Documentation/*.txt has its own format. Some follow markup notations, some don't even have a title! In order to try to get some order on it, change the document style to the standard we're adopting after the adoption of ReStructured Text. The documents touched on this series n

[PATCH 25/31] hw_random.txt: standardize document format

2017-05-18 Thread Mauro Carvalho Chehab
Each text file under Documentation follows a different format. Some doesn't even have titles! Change its representation to follow the adopted standard, using ReST markups for it to be parseable by Sphinx: - use proper markups for titles; - adjust section identation; - use proper markup for notes

[PATCH 00/30] Standardize doc formats - part 2

2017-05-18 Thread Mauro Carvalho Chehab
Each document under Documentation/*.txt has its own format. Some follow markup notations, some don't even have a title! In order to try to get some order on it, change the document style to the standard we're adopting after the adoption of ReStructured Text. The documents touched on this series n

[PATCH 26/30] padata.txt: standardize document format

2017-05-18 Thread Mauro Carvalho Chehab
Each text file under Documentation follows a different format. Some doesn't even have titles! Change its representation to follow the adopted standard, using ReST markups for it to be parseable by Sphinx: - mark document title; - mark literal blocks. Signed-off-by: Mauro Carvalho Chehab --- Do

[PATCH] staging: ccree: fix checkpatch no space before tabs

2017-05-18 Thread Branislav Katreniak
Fixes checkpatch warning: WARNING: please, no space before tabs Signed-off-by: Branislav Katreniak --- drivers/staging/ccree/cc_crypto_ctx.h | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/ccree/cc_crypto_ctx.h b/drivers/staging/ccree/cc_cr

[PATCH v2 2/4] crypto: drbg wait for crypto op not signal safe

2017-05-18 Thread Gilad Ben-Yossef
drbg_kcapi_sym_ctr() was using wait_for_completion_interruptible() to wait for completion of async crypto op but if a signal occurs it may return before DMA ops of HW crypto provider finish, thus corrupting the output buffer. Resolve this by using wait_for_completion() instead. Reported-by: Eric

[PATCH v2 0/4] crypto: async crypto op fixes

2017-05-18 Thread Gilad Ben-Yossef
This patch set fixes various usage and documentation errors in waiting for async crypto op to complete which can result in data corruption. Note: these were discovered in the process of working on a patch set that replaces these call sites and more with a generic implementation that will prevent t

[PATCH v2 3/4] crypto: gcm wait for crypto op not signal safe

2017-05-18 Thread Gilad Ben-Yossef
crypto_gcm_setkey() was using wait_for_completion_interruptible() to wait for completion of async crypto op but if a signal occurs it may return before DMA ops of HW crypto provider finish, thus corrupting the data buffer that is kfree'ed in this case. Resolve this by using wait_for_completion() i

[PATCH v2 1/4] crypto: handle EBUSY due to backlog correctly

2017-05-18 Thread Gilad Ben-Yossef
public_key_verify_signature() was passing the CRYPTO_TFM_REQ_MAY_BACKLOG flag to akcipher_request_set_callback() but was not handling correctly the case where a -EBUSY error could be returned from the call to crypto_akcipher_verify() if backlog was used, possibly casuing data corruption due to use-

[PATCH v2 4/4] crypto: Documentation: fix none signal safe sample

2017-05-18 Thread Gilad Ben-Yossef
The sample code was showing use of wait_for_completion_interruptible() for waiting for an async. crypto op to finish. However, if a signal arrived it would free the buffers used even while crypto HW might still DMA from/into the buffers. Resolve this by using wait_for_completion() instead. Report

Re: dm-crypt IV generation (summary)

2017-05-18 Thread Ondrej Mosnacek
2017-04-07 8:12 GMT+02:00 Herbert Xu : > On Fri, Mar 10, 2017 at 02:44:26PM +0100, Ondrej Mosnacek wrote: >> >> ISSUES: >> a) The 'keycount' parameter. >> In order to support multi-key modes from Loop-AES, >> dm-crypt accepts a keycount parameter which, if it != 1, causes >>

[PATCH v2 1/4] crypto: handle EBUSY due to backlog correctly

2017-05-18 Thread Gilad Ben-Yossef
public_key_verify_signature() was passing the CRYPTO_TFM_REQ_MAY_BACKLOG flag to akcipher_request_set_callback() but was not handling correctly the case where a -EBUSY error could be returned from the call to crypto_akcipher_verify() if backlog was used, possibly casuing data corruption due to use-

[PATCH v2 2/4] crypto: drbg wait for crypto op not signal safe

2017-05-18 Thread Gilad Ben-Yossef
drbg_kcapi_sym_ctr() was using wait_for_completion_interruptible() to wait for completion of async crypto op but if a signal occurs it may return before DMA ops of HW crypto provider finish, thus corrupting the output buffer. Resolve this by using wait_for_completion() instead. Reported-by: Eric

[PATCH v2 0/4] crypto: async crypto op fixes

2017-05-18 Thread Gilad Ben-Yossef
This patch set fixes various usage and documentation errors in waiting for async crypto op to complete which can result in data corruption. Note: these were discovered in the process of working on a patch set that replaces these call sites and more with a generic implementation that will prevent t

[PATCH v2 4/4] crypto: Documentation: fix none signal safe sample

2017-05-18 Thread Gilad Ben-Yossef
The sample code was showing use of wait_for_completion_interruptible() for waiting for an async. crypto op to finish. However, if a signal arrived it would free the buffers used even while crypto HW might still DMA from/into the buffers. Resolve this by using wait_for_completion() instead. Report

[PATCH v2 3/4] crypto: gcm wait for crypto op not signal safe

2017-05-18 Thread Gilad Ben-Yossef
crypto_gcm_setkey() was using wait_for_completion_interruptible() to wait for completion of async crypto op but if a signal occurs it may return before DMA ops of HW crypto provider finish, thus corrupting the data buffer that is kfree'ed in this case. Resolve this by using wait_for_completion() i

Re: [PATCH 2/4] crypto: drbg wait for crypto op not signal safe

2017-05-18 Thread Gilad Ben-Yossef
On Thu, May 18, 2017 at 8:09 AM, Herbert Xu wrote: > On Thu, May 11, 2017 at 02:53:43PM +0300, Gilad Ben-Yossef wrote: >> drbg_kcapi_sym_ctr() was using wait_for_completion_interruptible() to >> wait for completion of async crypto op but if a signal occurs it >> may return before DMA ops of HW cry