Re: vmalloced stacks and scatterwalk_map_and_copy()

2016-11-21 Thread Eric Biggers
On Mon, Nov 21, 2016 at 04:26:19PM +0800, Herbert Xu wrote: > crypto: scatterwalk - Remove unnecessary aliasing check in map_and_copy > > The aliasing check in map_and_copy is no longer necessary because > the IPsec ESP code no longer provides an IV that points into the > actual request data. As

[PATCH v2 4/9] crypto/chcr: Remove dynamic allocation

2016-11-21 Thread Harsh Jain
Remove malloc/free in hash operation and allocate memory in chcr_ahash_req_ctx structure. Signed-off-by: Jitendra Lulla --- drivers/crypto/chelsio/chcr_algo.c | 69 +--- drivers/crypto/chelsio/chcr_crypto.h | 8 +++-- 2 files changed, 45 insertions(+), 32 dele

[PATCH v2 6/9] crypto/chcr: Adjust Dest. buffer size

2016-11-21 Thread Harsh Jain
Destination buffer size passed to hardware should not be greater than crypto operation output. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 50 +++--- 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/drivers/crypto/chelsio/chcr

[PATCH v2 5/9]crypto/chcr: Calculate Reverse round key in setkey callback.

2016-11-21 Thread Harsh Jain
Move reverse round key calculation logic in setkey operation. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 52 drivers/crypto/chelsio/chcr_crypto.h | 2 +- 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/drivers/crypt

[PATCH v2 7/9] crypto/chcr: Use SHASH_DESC_ON_STACK

2016-11-21 Thread Harsh Jain
Use SHASH_DESC_ON_STACK macro to allocate memory for ipad/opad calculation. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 63 +++- drivers/crypto/chelsio/chcr_crypto.h | 2 +- 2 files changed, 27 insertions(+), 38 deletions(-) diff --git a

[PATCH v2 8/9] crypto/chcr: Move tfm ctx variable to request context

2016-11-21 Thread Harsh Jain
Move request specific data in request context. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 26 +- drivers/crypto/chelsio/chcr_crypto.h | 9 - 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_alg

[PATCH v2 9/9] crypto/chcr: Add AEAD algos

2016-11-21 Thread Harsh Jain
Add support for following AEAD algos. GCM,CCM,RFC4106,RFC4309,authenc(hmac(shaXXX),cbc(aes)). Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/Kconfig |1 + drivers/crypto/chelsio/chcr_algo.c | 1482 +- drivers/crypto/chelsio/chcr_algo.h | 16

[PATCH v2 3/9] crypto/chcr: Fixes Unchecked dereference inside function

2016-11-21 Thread Harsh Jain
Fixes 324429d74127, Unchecked dereference inside function. Reported-by: Dan Carpenter Signed-off-by: Jitendra Lulla --- drivers/crypto/chelsio/chcr_algo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo

[PATCH v2 2/9]crypto/chcr: Added new structure chcr_wr to populate Work Request Header.

2016-11-21 Thread Harsh Jain
Signed-off-by: Jitendra Lulla --- drivers/crypto/chelsio/chcr_algo.c | 239 +-- drivers/crypto/chelsio/chcr_algo.h | 28 ++-- drivers/crypto/chelsio/chcr_core.h | 16 +++ drivers/crypto/chelsio/chcr_crypto.h | 6 - 4 files changed, 140 insertions(+), 149

[PATCH v2 1/9] crypto/chcr:Fix memory corruption done

2016-11-21 Thread Harsh Jain
Fix memory corruption done by *((u32 *)dec_key + k) operation. Signed-off-by: Jitendra Lulla --- drivers/crypto/chelsio/chcr_algo.c | 52 ++ drivers/crypto/chelsio/chcr_algo.h | 58 +- 2 files changed, 53 insertions(+), 57 dele

[PATCH v2 0/9] crypto/chcr: AEAD support and bug fixes

2016-11-21 Thread Harsh Jain
This patch series includes Bug Fixes, performance improvement and support for following AEAD algos. GCM,CCM,RFC4106,RFC4303,authenc(hmac(shaXXX),cbc(aes)) Jitendra Lulla (4): chcr:Fix memory corruption done Added new structure chcr_wr to populate Work Request Header. Fixes: 324429d74127, Unc

Re: [PATCH] hw_random: Make explicit that max >= 32 always

2016-11-21 Thread Herbert Xu
On Fri, Nov 18, 2016 at 11:00:10PM +0530, PrasannaKumar Muralidharan wrote: > As hw_random core calls ->read with max > 32 or more, make it explicit. > Also remove checks involving 'max' being less than 8. > > Signed-off-by: PrasannaKumar Muralidharan Patch applied. Thanks. -- Email: Herbert X

Re: [PATCH] crypto: CTR DRBG - advance output buffer pointer

2016-11-21 Thread Herbert Xu
On Fri, Nov 18, 2016 at 12:27:56PM +0100, Stephan Mueller wrote: > The CTR DRBG segments the number of random bytes to be generated into > 128 byte blocks. The current code misses the advancement of the output > buffer pointer when the requestor asks for more than 128 bytes of data. > In this case,

[RFC PATCH] IV Generation algorithms for dm-crypt

2016-11-21 Thread Binoy Jayan
=== GENIV Template cipher === Currently, the iv generation algorithms are implemented in dm-crypt.c. The goal is to move these algorithms from th

[RFC PATCH] crypto: Add IV generation algorithms

2016-11-21 Thread Binoy Jayan
Currently, the iv generation algorithms are implemented in dm-crypt.c. The goal is to move these algorithms from the dm layer to the kernel crypto layer by implementing them as template ciphers so they can be used in relation with algorithms like aes, and with multiple modes like cbc, ecb etc. As p

Re: vmalloced stacks and scatterwalk_map_and_copy()

2016-11-21 Thread Herbert Xu
On Sun, Nov 20, 2016 at 06:19:48PM -0800, Andy Lutomirski wrote: > > > Herbert, can you clarify this? The check seems rather bizarre -- > > you're doing an incomplete check for aliasing and skipping the whole > > copy if the beginning aliases. In any event the stack *can't* > > reasonably alias t