kernel tainted while exporting shash context using af_alg interface

2015-10-25 Thread Harsh Jain
Hi, When trying to calculate HMAC(SHA1) with openssl using af-alg engine kernel crashes.Find below the command used and kernel. I have added some debug print in logs. Command used : ./openssl dgst -engine af_alg -sha1 -hmac "key" r.txt kernel version : 3.17.8 Initial Investigation : In

Re: kernel tainted while exporting shash context using af_alg interface

2015-10-26 Thread Harsh Jain
Hi Stephan, I tried 1 more patch. This time result is correct. Find attached patch file. Is there any side effect of this patch. Regards Harsh Jain On Mon, Oct 26, 2015 at 11:49 AM, Harsh Jain <harshjain.p...@gmail.com> wrote: > Hi Stephan, > > I also tried test prog

Re: kernel tainted while exporting shash context using af_alg interface

2015-10-26 Thread Harsh Jain
d strace.Right now af_alg code is not accessible to me. I will share it tomorrow. Thanks and Regards Harsh jain On Sun, Oct 25, 2015 at 5:28 PM, Stephan Mueller <smuel...@chronox.de> wrote: > Am Sonntag, 25. Oktober 2015, 11:56:27 schrieb Harsh Jain: > > Hi Harsh, >

Re: kernel tainted while exporting shash context using af_alg interface

2015-10-28 Thread Harsh Jain
Hi Stephan, I tried your patch on my machine. Kernel is not crashing. The openssl break with this. Can you share HMAC program which you are suspecting it will not work or do you already have some test written in libkcapi/test.sh which will fail. Regards Harsh Jain On Wed, Oct 28, 2015 at 6:25

Re: kernel tainted while exporting shash context using af_alg interface

2015-10-30 Thread Harsh Jain
uot;ctx->more" =1 after initialisation. Correct me If I am wrong. Thanks for your support. regards Harsh Jain On Wed, Oct 28, 2015 at 4:53 PM, Stephan Mueller <smuel...@chronox.de> wrote: > Am Mittwoch, 28. Oktober 2015, 16:24:34 schrieb Harsh Jain: > > Hi Harsh, > &g

Re: kernel tainted while exporting shash context using af_alg interface

2015-11-01 Thread Harsh Jain
Hi, I tried patch on my setup and its working fine. Thanks Stephan, Herbert for your support. Regards Harsh Jain On Fri, Oct 30, 2015 at 4:40 PM, Stephan Mueller <smuel...@chronox.de> wrote: > Am Freitag, 30. Oktober 2015, 14:02:27 schrieb Harsh Jain: > > Hi Harsh, > >&g

Re: [PATCH v2] crypto: algif_hash - Only export and import on sockets with data

2015-11-04 Thread Harsh Jain
Hi herbert, Which kernel versions will have this patch? Regards Harsh Jain On Mon, Nov 2, 2015 at 8:42 AM, Herbert Xu <herb...@gondor.apana.org.au> wrote: > On Sun, Nov 01, 2015 at 12:07:12PM +0100, Stephan Mueller wrote: >> Am Sonntag, 1. November 2015, 17:11:19 schrieb Herbe

Test AEAD/authenc algorithms from userspace

2016-05-31 Thread Harsh Jain
ciphertext are sent together. 3) MAC-then-Encrypt (MtE) A MAC is produced based on the plaintext, then the plaintext and MAC are together encrypted to produce a ciphertext based on both. The ciphertext (containing an encrypted MAC) is sent. Regards Harsh Jain -- To unsubscribe from this list: sen

Re: Test AEAD/authenc algorithms from userspace

2016-05-31 Thread Harsh Jain
dff7fb2 -l 16f4a3eacfbdadd3b1a17117b1d67ffc1f1e21efbbc6d83724a8c296e3bb8cda0c44 It gives following error with kernel 4.5.2 Symmetric cipher setkey failed Failed to invoke testing Regards Harsh Jain On Tue, May 31, 2016 at 12:35 PM, Stephan Mueller <smuel...@chronox.de> wrote: > Am Diensta

Re: Test AEAD/authenc algorithms from userspace

2016-05-31 Thread Harsh Jain
Hi, Thanks Stephen, I will check the same.1 suggestion for kcapi tool. Add some switch cases in tool to test digest and finup path of crypto driver. Current implementation triggers only init/update/final. Regards Harsh Jain On Tue, May 31, 2016 at 2:29 PM, Stephan Mueller <smuel...@chronox

Re: Test AEAD/authenc algorithms from userspace

2016-05-31 Thread Harsh Jain
Hi, 1) User can use libkcapi to write program for finup/digest. 2) No, kernel test for finup (not sure). 3) We can test all callback of new hash tfm drivers added in kernel. 4) My driver had issue in finup path which is not caught by kcapi test program :) regards Harsh Jain regards Harsh Jain

Re: Test AEAD/authenc algorithms from userspace

2016-05-31 Thread Harsh Jain
). In that way we can test all callbacks from userspace. In future if you feel this use case important. You can add API's to implement this. Regards Harsh Jain regards Harsh Jain regards Harsh Jain On Tue, May 31, 2016 at 2:51 PM, Stephan Mueller <smuel...@chronox.de> wrote: > Am D

Re: Encryption output buffer description in algif_aead.c file

2016-06-24 Thread Harsh Jain
Yes, I will share the patch. regards Harsh Jain On Fri, Jun 24, 2016 at 5:31 PM, Stephan Mueller <smuel...@chronox.de> wrote: > Am Freitag, 24. Juni 2016, 17:24:02 schrieb Harsh Jain: > > Hi Harsh, > > >> 379 * The memory structure for cipher operati

Encryption output buffer description in algif_aead.c file

2016-06-24 Thread Harsh Jain
* AEAD decryption output: plaintext 385 */ Regards Harsh Jain -- 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.kernel.org/majordomo-info.html

Re: Max data limit for AEAD operation

2016-07-21 Thread Harsh Jain
Hi, Thank for reply. As such I don't have any use case. But the use case I can think of is AEAD operation on large file using AF_ALG interface. If user tried this he/she will get invalid TAG value. Regards Harsh Jain On Fri, Jul 22, 2016 at 10:10 AM, Herbert Xu <herb...@gondor.apana.org

Max data limit for AEAD operation

2016-07-21 Thread Harsh Jain
Hi All, There is maximum limit of data which crypto user can send(in encrypt) to get TAG in AEAD operations. We do not have update/final like implementation for AEAD algo's. why is this so? Regards Harsh Jain -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" i

[PATCH] Remove redundant sg_init_table call.

2016-06-28 Thread Harsh Jain
Remove redundant sg_init_table call. scatterwalk_ffwd doing the same. Signed-off-by: Harsh Jain <harshjain.p...@gmail.com> --- crypto/authenc.c |7 +-- 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/crypto/authenc.c b/crypto/authenc.c index 55a354d..c7cc11d

Why null skcipher to copy AAD data?

2016-07-04 Thread Harsh Jain
Hi, Why we need null skcipher to copy AAD from src to dst buffer. We can do the same with some function,who can copy data from src sg list to dst sg list. Regards Harsh Jain -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message

[PATCH 1/1] crypto:algif_aead - Fix kernel panic on list_del

2017-02-01 Thread Harsh Jain
Kernel panics when userspace program try to access AEAD interface. Remove node from Linked List before freeing its memory. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- crypto/algif_aead.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/algif_aead.c b/

[PATCH v2 1/2] crypto:chcr- Fix panic on dma_unmap_sg

2017-01-23 Thread Harsh Jain
Save DMA mapped sg list addresses to request context buffer. Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chcr_algo.c | 49 +++- drivers/crypto/chelsio/chcr_crypto.h | 3 +++ 2 files changed, 29 insertions(+), 23 deletions(-)

[PATCH v2 0/2 ] Bug Fixes for 4.10

2017-01-23 Thread Harsh Jain
This patch series includes critical bug fixes Atul Gupta (2): crypto:chcr- Fix panic on dma_unmap_sg crypto:chcr- Check device is allocated before use drivers/crypto/chelsio/chcr_algo.c | 49 +++- drivers/crypto/chelsio/chcr_core.c | 18 ++---

[PATCH v2 2/2] crypto:chcr- Check device is allocated before use

2017-01-23 Thread Harsh Jain
Ensure dev is allocated for crypto uld context before using the device for crypto operations. Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chcr_core.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git

[PATCH 5/8] crypto:chcr: Change cra_flags for cipher algos

2017-01-27 Thread Harsh Jain
Change cipher algos flags to CRYPTO_ALG_TYPE_ABLKCIPHER. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c

[PATCH 2/8] crypto:chcr- Fix key length for RFC4106

2017-01-27 Thread Harsh Jain
Check keylen before copying salt to avoid wrap around of Integer. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_

[PATCH 3/8] crypto:chcr-fix itnull.cocci warnings

2017-01-27 Thread Harsh Jain
The first argument to list_for_each_entry cannot be NULL. Generated by: scripts/coccinelle/iterators/itnull.cocci Signed-off-by: Julia Lawall <julia.law...@lip6.fr> Signed-off-by: Fengguang Wu <fengguang...@intel.com> Signed-off-by: Harsh Jain <ha...@chelsio.com> --- driv

[PATCH 0/8] Bug fixes

2017-01-27 Thread Harsh Jain
This patch series is based on Herbert's cryptodev-2.6 tree and depends on patch series "Bug Fixes for 4.10". It includes Bug Fixes. Atul Gupta (2) crypto:chcr-Change flow IDs crypto:chcr- Fix wrong typecasting Harsh Jain (8): crypto:chcr- Fix key length for RFC4106 crypt

[PATCH 6/8] crypto:chcr- Change algo priority

2017-01-27 Thread Harsh Jain
Update priorities to 3000 Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_crypto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/chelsio/chcr_crypto.h b/drivers/crypto/chelsio/chcr_crypto.h index 7ec0a8f..81cfd0b

[PATCH 8/8] crypto:chcr-Fix Smatch Complaint

2017-01-27 Thread Harsh Jain
Initialise variable after null check. Reported-by: Dan Carpenter <dan.carpen...@oracle.com> Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) mode change 100644 => 100755 drivers

[PATCH 7/8] crypto:chcr- Fix wrong typecasting

2017-01-27 Thread Harsh Jain
Typecast the pointer with correct structure. Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chcr_core.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_core.c b/drivers/crypto/chelsio/chcr_core.c index

[PATCH 4/8] crypto:chcr- Use cipher instead of Block Cipher in gcm setkey

2017-01-27 Thread Harsh Jain
1 Block of encrption can be done with aes-generic. no need of cbc(aes). This patch replaces cbc(aes-generic) with aes-generic. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-)

[PATCH 1/8] crypto:chcr-Change flow IDs

2017-01-27 Thread Harsh Jain
Change assign flowc id to each outgoing request.Firmware use flowc id to schedule each request onto HW. FW reply may miss without this change. Reviewed-by: Hariprasad Shenai Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chcr_algo.c

BUG: af_alg bind fails for 50 % request from userspace for hash algo

2017-02-15 Thread Harsh Jain
rypto test executions). If I execute same test again issue didn't reproduce. Regards Harsh Jain

Who will copy the AAD data to dest. buffer

2016-09-02 Thread Harsh Jain
to dest. buffer. http://www.chronox.de/libkcapi/html/ch02s02.html Secondly When AAD data remains unchanged in AEAD encryption/decryption operations. Why we copy the same data to destination buffer? Thanks & Regards Harsh Jain -- To unsubscribe from this list: send the line "unsubscribe lin

rmmod crypto driver when ipsec is in use

2016-09-08 Thread Harsh Jain
Hi, What is the expected behavior when driver is unregistered(Rmmod ) with active ipsec session.? I am getting stacktrace(BUG_ON in crypto_unregister_alg) instead of "module in use". Regards Harsh Jain -- To unsubscribe from this list: send the line "unsubscribe linux-cryp

Re: [PATCH 6/6] Add support for AEAD algos.

2016-10-27 Thread Harsh Jain
On 14-10-2016 19:54, Stephan Mueller wrote: > Am Donnerstag, 13. Oktober 2016, 16:39:39 CEST schrieb Harsh Jain: > > Hi Harsh, > >> Add support for following AEAD algos. >> GCM,CCM,RFC4106,RFC4309,authenc(hmac(shaXXX),cbc(aes)). >> >> Signed-o

Re: [PATCH 6/6] Add support for AEAD algos.

2016-11-08 Thread Harsh Jain
On 08-11-2016 18:29, Stephan Mueller wrote: > Am Dienstag, 8. November 2016, 17:16:38 CET schrieb Harsh Jain: > > Hi Harsh, > >> On 08-11-2016 16:45, Stephan Mueller wrote: >>> Am Donnerstag, 27. Oktober 2016, 15:36:08 CET schrieb Harsh Jain: >>> &

Re: [PATCH 6/6] Add support for AEAD algos.

2016-11-09 Thread Harsh Jain
On 08-11-2016 19:51, Harsh Jain wrote: > > On 08-11-2016 18:29, Stephan Mueller wrote: >> Am Dienstag, 8. November 2016, 17:16:38 CET schrieb Harsh Jain: >> >> Hi Harsh, >> >>> On 08-11-2016 16:45, Stephan Mueller wrote: >>>> Am Donnerstag

Re: [PATCH 6/6] Add support for AEAD algos.

2016-11-08 Thread Harsh Jain
On 08-11-2016 16:45, Stephan Mueller wrote: > Am Donnerstag, 27. Oktober 2016, 15:36:08 CET schrieb Harsh Jain: > > Hi Harsh, > >>>> +static void chcr_verify_tag(struct aead_request *req, u8 *input, int >>>> *err) >>>> +{ >>>> +

[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,

[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

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

2016-11-21 Thread Harsh Jain
, Unchecked dereference inside function. Remove malloc/free in hash operation and allocate memory in chcr_ahash_req_ctx structure. Harsh Jain (5): Calculate Reverse round key in setkey callback. chcr: Adjust Dest. buffer size chcr: Use SHASH_DESC_ON_STACK chcr: Move tfm ctx variable

[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 <ha...@chelsio.com> --- drivers/crypto/chelsio/Kconfig |1 + drivers/crypto/chelsio/chcr_algo.c | 1482 +- drivers/crypto/c

[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 <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 26 +- drivers/crypto/chelsio/chcr_crypto.h | 9 - 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/d

[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 <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 52 drivers/crypto/chelsio/chcr_crypto.h | 2 +- 2 files changed, 24 insertions(+), 30 deletions(-)

[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 <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 63 +++- drivers/crypto/chelsio/chcr_crypto.h | 2 +- 2 files changed, 27 insertions(

[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

[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 <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 50 +++--- 1 file changed, 20 insertions(+), 30 deletions(-) diff --git a/d

[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

Re: [PATCH 2/6] chcr: Remove malloc/free

2016-10-26 Thread Harsh Jain
On 21-10-2016 07:50, Herbert Xu wrote: > On Thu, Oct 13, 2016 at 04:39:35PM +0530, Harsh Jain wrote: >> Remove malloc/free in crypto operation and allocate memory via cra_ctxsize. >> Added new structure chcr_wr to populate Work Request Header. >> Fixes: 324429d74127 (chcr:

[PATCH 3/6] chcr: Adjust Dest. buffer size

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

[PATCH 6/6] Add support for AEAD algos.

2016-10-13 Thread Harsh Jain
Add support for following AEAD algos. GCM,CCM,RFC4106,RFC4309,authenc(hmac(shaXXX),cbc(aes)). Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/Kconfig |1 + drivers/crypto/chelsio/chcr_algo.c | 1466 +- drivers/crypto/c

[PATCH 5/6] chcr: Move tfm ctx variable to request context

2016-10-13 Thread Harsh Jain
Move tfm ctx variable to request context. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- 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/

[PATCH 4/6] chcr: Use SHASH_DESC_ON_STACK

2016-10-13 Thread Harsh Jain
Use SHASH_DESC_ON_STACK macro to allocate memory for ipad/opad calculation. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 63 +++- drivers/crypto/chelsio/chcr_crypto.h | 2 +- 2 files changed, 27 insertions(

[PATCH 2/6] chcr: Remove malloc/free

2016-10-13 Thread Harsh Jain
Remove malloc/free in crypto operation and allocate memory via cra_ctxsize. Added new structure chcr_wr to populate Work Request Header. Fixes: 324429d74127 (chcr: Support for Chelsio's Crypto Hardware) Reported-by: Dan Carpenter Signed-off-by: Jitendra Lulla

[PATCH 0/6] chcr: AEAD support and bug fixes

2016-10-13 Thread Harsh Jain
ion buffer size passed to hardware should not be greater than crypto operation output. Harsh Jain (3): Use SHASH_DESC_ON_STACK macro to allocate memory for ipad/opad calculation. Move tfm ctx variable to request context. Add support for AEAD algos GCM,CCM,RFC4106,RFC4303,authenc(h

[PATCH 1/6] chcr:Fix memory corruption done

2016-10-13 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

Re: [PATCH v1 3/8] crypto:chcr- Fix key length for RFC4106

2017-01-12 Thread Harsh Jain
On 12-01-2017 21:39, Herbert Xu wrote: > On Fri, Jan 06, 2017 at 02:01:34PM +0530, Harsh Jain wrote: >> Check keylen before copying salt to avoid wrap around of Integer. >> >> Signed-off-by: Harsh Jain <ha...@chelsio.com> >> --- >> drivers/crypto/chelsio/

[PATCH v1 3/4] crypto:chcr- Check device is allocated before use

2017-01-13 Thread Harsh Jain
Ensure dev is allocated for crypto uld context before using the device for crypto operations. Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chcr_core.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git

[PATCH v1 2/4] crypto:chcr- Fix panic on dma_unmap_sg

2017-01-13 Thread Harsh Jain
Save DMA mapped sg list addresses to request context buffer. Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chcr_algo.c | 49 +++- drivers/crypto/chelsio/chcr_crypto.h | 3 +++ 2 files changed, 29 insertions(+), 23 deletions(-)

[PATCH v1 0/4]crypto:chcr- Bug Fixes for 4.10

2017-01-13 Thread Harsh Jain
This patch series is based on Herbert's cryptodev-2.6 tree. It includes several critical bug fixes. Atul Gupta (3): crypto:chcr-Change flow IDs crypto:chcr- Fix panic on dma_unmap_sg crypto:chcr- Check device is allocated before use Julia Lawall (1): crypto:chcr-fix itnull.cocci warnings

[PATCH v1 1/4] crypto:chcr-Change flow IDs

2017-01-13 Thread Harsh Jain
Change assign flowc id to each outgoing request.Firmware use flowc id to schedule each request onto HW. FW reply may lost without this change. Reviewed-by: Hariprasad Shenai Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chcr_algo.c

[PATCH v1 4/4] crypto:chcr-fix itnull.cocci warnings

2017-01-13 Thread Harsh Jain
The first argument to list_for_each_entry cannot be NULL. Generated by: scripts/coccinelle/iterators/itnull.cocci Signed-off-by: Julia Lawall <julia.law...@lip6.fr> Signed-off-by: Fengguang Wu <fengguang...@intel.com> Signed-off-by: Harsh Jain <ha...@chelsio.com> --- driv

[PATCH v3 05/10] crypto/chcr: Remove dynamic allocation

2016-11-29 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

[PATCH v3 04/10] crypto/chcr: Fixes Unchecked dereference inside function

2016-11-29 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

[PATCH v3 10/10] Add AEAD algos.

2016-11-29 Thread Harsh Jain
Add support for following AEAD algos. GCM,CCM,RFC4106,RFC4309,authenc(hmac(shaXXX),cbc(aes)). Reviewed-by: Stephan Mueller <smuel...@chronox.de> Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/Kconfig |1 + drivers/crypto/chelsio/chcr_alg

[PATCH v3 03/10] crypto/chcr: Added new structure chcr_wr

2016-11-29 Thread Harsh Jain
Added new structure chcr_wr to populate Work Request Header. 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 +++

[PATCH v3 02/10] crypto/chcr:Cosmetic change

2016-11-29 Thread Harsh Jain
Moves get_aes_decrypt_key function to .c file and declare inline for "aes_ks_subword" Signed-off-by: Jitendra Lulla --- drivers/crypto/chelsio/chcr_algo.c | 52 + drivers/crypto/chelsio/chcr_algo.h | 59 +-

[PATCH v3 00/10] crypto/chcr: AEAD support and bug fixes

2016-11-29 Thread Harsh Jain
structure chcr_wr to populate Work Request Header. crypto/chcr: Fixes Unchecked dereference inside function crypto/chcr: Remove dynamic allocation Harsh Jain (5): crypto/chcr: Calculate Reverse round key in setkey callback. crypto/chcr: Adjust Dest. buffer size crypto/chcr: Use SHASH_DES

[PATCH v3 07/10] crypto/chcr: Adjust Dest. buffer size

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

[PATCH v3 09/10] crypto/chcr: Move tfm ctx variable to request context

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

[PATCH v3 06/10] crypto/chcr: Calculate Reverse round key in setkey callback.

2016-11-29 Thread Harsh Jain
Move reverse round key calculation logic in setkey operation. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 52 drivers/crypto/chelsio/chcr_crypto.h | 2 +- 2 files changed, 24 insertions(+), 30 deletions(-)

[PATCH v3 01/10] crypto/chcr:Fix memory corruption

2016-11-29 Thread Harsh Jain
Fix memory corruption done by *((u32 *)dec_key + k) operation. Signed-off-by: Jitendra Lulla --- drivers/crypto/chelsio/chcr_algo.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/chelsio/chcr_algo.h

[PATCH v3 08/10] crypto/chcr: Use SHASH_DESC_ON_STACK

2016-11-29 Thread Harsh Jain
Use SHASH_DESC_ON_STACK macro to allocate memory for ipad/opad calculation. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 63 +++- drivers/crypto/chelsio/chcr_crypto.h | 2 +- 2 files changed, 27 insertions(

Re: [patch] crypto: chcr - checking for IS_ERR() instead of NULL

2016-12-01 Thread Harsh Jain
On 02-12-2016 11:29, Harsh Jain wrote: > > On 02-12-2016 02:19, Dan Carpenter wrote: >> The create_hash_wr() function never returns error pointers. It returns >> NULL on error. > Will fix the same, Thanks It's a patch mail not bug reporting! Sorry for confusion. Yo

Re: [patch] crypto: chcr - checking for IS_ERR() instead of NULL

2016-12-01 Thread Harsh Jain
On 02-12-2016 02:19, Dan Carpenter wrote: > The create_hash_wr() function never returns error pointers. It returns > NULL on error. Will fix the same, Thanks > > Fixes: 358961d1cd1e ("crypto: chcr - Added new structure chcr_wr") > Signed-off-by: Dan Carpenter > > diff

[PATCH v1 4/8] crypto:chcr- Use cipher instead of Block Cipher in gcm setkey

2017-01-06 Thread Harsh Jain
1 Block of encrption can be done with aes-generic. no need of cbc(aes). This patch replaces cbc(aes-generic) with aes-generic. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-)

[PATCH v1 7/8] crypto:chcr- Check device is allocated before use

2017-01-06 Thread Harsh Jain
Ensure dev is allocated for crypto uld context before using the device for crypto operations. Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chcr_core.c | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git

[PATCH v1 5/8] crypto:chcr: Change cra_flags for cipher algos

2017-01-06 Thread Harsh Jain
Change cipher algos flags to CRYPTO_ALG_TYPE_ABLKCIPHER. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c

[PATCH v1 0/8] crypto:chcr- Bug fixes

2017-01-06 Thread Harsh Jain
The patch series is based on Herbert's cryptodev-2.6 tree. It include bug fixes. Atul Gupta (4): crypto:chcr-Change flow IDs crypto:chcr- Fix panic on dma_unmap_sg crypto:chcr- Check device is allocated before use crypto:chcr- Fix wrong typecasting Harsh Jain (4): crypto:chcr- Fix key

[PATCH v1 3/8] crypto:chcr- Fix key length for RFC4106

2017-01-06 Thread Harsh Jain
Check keylen before copying salt to avoid wrap around of Integer. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_

[PATCH v1 2/8] crypto:chcr- Fix panic on dma_unmap_sg

2017-01-06 Thread Harsh Jain
Save DMA mapped sg list addresses to request context buffer. Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chcr_algo.c | 49 +++- drivers/crypto/chelsio/chcr_crypto.h | 3 +++ 2 files changed, 29 insertions(+), 23 deletions(-)

[PATCH v1 8/8] crypto:chcr- Fix wrong typecasting

2017-01-06 Thread Harsh Jain
Typecast the pointer with correct structure. Signed-off-by: Atul Gupta --- drivers/crypto/chelsio/chcr_core.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_core.c b/drivers/crypto/chelsio/chcr_core.c index

Re: Test AEAD/authenc algorithms from userspace

2016-12-22 Thread Harsh Jain
On 21-12-2016 14:24, Herbert Xu wrote: > On Mon, Dec 19, 2016 at 04:08:11PM +0530, Harsh Jain wrote: >> Hi Herbert, >> >> TLS default mode of operation is MAC-then-Encrypt for Authenc algos. >> Currently framework only supports EtM used in IPSec. User space >> pr

Re: Test AEAD/authenc algorithms from userspace

2016-12-19 Thread Harsh Jain
releases? Regards Harsh Jain On Tue, May 31, 2016 at 12:35 PM, Stephan Mueller <smuel...@chronox.de> wrote: > Am Dienstag, 31. Mai 2016, 12:31:16 schrieb Harsh Jain: > > Hi Harsh, > >> Hi All, >> >> How can we open socket of type "authenc(hmac(sha256),cbc

BUG: Seems un-initialed dst pointer received from algif_aead when outlen is zero

2017-03-21 Thread Harsh Jain
20ee6b7 -k f4a6a5e5f2066f6dd9ec6fc5169c29043560ef595c9e81e76f42d29212cc581c -a "" -t "5f24c68cbe6f32c29652442bf5d483ad" -q "" Its decrypt operation. Expected result should be EBADMSG. Regards Harsh Jain

Re: BUG: Seems un-initialed dst pointer received from algif_aead when outlen is zero

2017-03-21 Thread Harsh Jain
On Tue, Mar 21, 2017 at 5:13 PM, Stephan Müller <smuel...@chronox.de> wrote: > Am Dienstag, 21. März 2017, 11:59:54 CET schrieb Harsh Jain: > > Hi Harsh, > >> > Executing this command on a 4.9 kernel, I get: >> > >> > bin/kcapi -x 2

Re: BUG: Seems un-initialed dst pointer received from algif_aead when outlen is zero

2017-03-21 Thread Harsh Jain
On Tue, Mar 21, 2017 at 3:34 PM, Stephan Müller <smuel...@chronox.de> wrote: > Am Dienstag, 21. März 2017, 07:13:53 CET schrieb Harsh Jain: > > Hi Harsh, > >> Hi, >> >> For tag only AEAD decrypt operation(Zero length Payload). The dst sg >> list pointer pa

Re: BUG: Seems un-initialed dst pointer received from algif_aead when outlen is zero

2017-03-21 Thread Harsh Jain
On Tue, Mar 21, 2017 at 4:29 PM, Harsh Jain <harshjain.p...@gmail.com> wrote: > On Tue, Mar 21, 2017 at 3:34 PM, Stephan Müller <smuel...@chronox.de> wrote: >> Am Dienstag, 21. März 2017, 07:13:53 CET schrieb Harsh Jain: >> >> Hi Harsh, >> >>> Hi,

Re: What should be the algo priority

2017-04-05 Thread Harsh Jain
On Tue, Apr 4, 2017 at 6:07 PM, Stephan Müller <smuel...@chronox.de> wrote: > Am Dienstag, 4. April 2017, 09:53:17 CEST schrieb Harsh Jain: > > Hi Harsh, > >> Hi, >> >> Do we have any guidelines documented to decide what should be the >>

[PATCH 2/4] chcr:Set hmac_ctrl bit to use HW register HMAC_CFG[456]

2017-04-10 Thread Harsh Jain
Use hmac_ctrl bit value saved in setauthsize callback. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 24 +--- 1 files changed, 5 insertions(+), 19 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/

[PATCH 1/4] chcr: Increase priority of AEAD algos.

2017-04-10 Thread Harsh Jain
-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 12 ++-- drivers/crypto/chelsio/chcr_crypto.h |4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c index 4

[PATCH 0/4] Bug fixes and fallback for AEAD

2017-04-10 Thread Harsh Jain
This series based on Herbert cryptodev-2.6. It includes bug fixes and fallback for AEAD algos. Harsh Jain (3): chcr: Increase priority of AEAD algos. chcr:Set hmac_ctrl bit to use HW register HMAC_CFG[456]. chcr: Add fallback for AEAD algos Atul Gupta (1): chcr: Fix txq ids drivers

[PATCH 4/4] chcr: Add fallback for AEAD algos

2017-04-10 Thread Harsh Jain
Fallback to sw when I AAD length greater than 511 II Zero length payload II No of sg entries exceeds Request size. Signed-off-by: Harsh Jain <ha...@chelsio.com> --- drivers/crypto/chelsio/chcr_algo.c | 219 ++ drivers/crypto/chelsio/chcr_

[PATCH 3/4] chcr:Fix txq ids.

2017-04-10 Thread Harsh Jain
The patch fixes a critical issue to map txqid with flows on the hardware appropriately, if tx queues created are more than flows configured then txqid shall map within the range of hardware flows configured. This ensure that un-mapped txqid does not remain un-handled. The patch also segregated

Re: [PATCH 08/22] crypto: chcr: Make use of the new sg_map helper function

2017-04-14 Thread Harsh Jain
On Fri, Apr 14, 2017 at 3:35 AM, Logan Gunthorpe wrote: > The get_page in this area looks *highly* suspect due to there being no > corresponding put_page. However, I've left that as is to avoid breaking > things. chcr driver will post the request to LLD driver cxgb4 and

Re: [PATCH 2/2] crypto: chcr - Fix error checking

2017-04-13 Thread Harsh Jain
On Thu, Apr 13, 2017 at 8:20 PM, Christophe JAILLET wrote: > Le 13/04/2017 à 16:04, Dan Carpenter a écrit : >> >> On Thu, Apr 13, 2017 at 02:14:30PM +0200, Christophe JAILLET wrote: >>> >>> If 'chcr_alloc_shash()' a few lines above fails, 'base_hash' can be an >>>

Re: [PATCH 5/8] crypto:chcr: Change cra_flags for cipher algos

2017-03-08 Thread Harsh Jain
Hi Herbert On Fri, Jan 27, 2017 at 4:09 PM, Harsh Jain <ha...@chelsio.com> wrote: > Change cipher algos flags to CRYPTO_ALG_TYPE_ABLKCIPHER. > > Signed-off-by: Harsh Jain <ha...@chelsio.com> > --- > drivers/crypto/chelsio/chcr_algo.c | 6 +++--- > 1 file changed

Re: [bug report] crypto: chcr - Select device in Round Robin fashion

2017-07-24 Thread Harsh Jain
On 20-07-2017 16:02, Dan Carpenter wrote: > Hello Harsh Jain, > > The patch 14c19b178a01: "crypto: chcr - Select device in Round Robin > fashion" from Jun 15, 2017, leads to the following static checker > warning: > > drivers/crypto/chelsio/chcr_core.c:

BUG: drbg: Added nodes from Stack Memory in link list

2017-05-03 Thread Harsh Jain
s't a BUG? or I missed something. Regards Harsh Jain

Re: Can someone check linux kernel 4.4, and 4.9 rfc4309 test vectors?

2017-06-09 Thread Harsh Jain
On Wed, Jun 7, 2017 at 7:27 PM, Che-Min Hsieh wrote: > Rfc4309 test vectors in testmgr.h have gone through major changes from linux3 > to linux4. > In linux 4.4, linux4.9, there are vectors as such > > 23194 static struct aead_testvec aes_ccm_rfc4309_enc_tv_template[]

  1   2   >