[PATCH 3/3] crypto: ccp - protect RSA implementation from too large input data

2018-02-24 Thread Maciej S. Szmigiero
CCP RSA implementation uses a hardware input buffer which size depends only on the current RSA key length. Key modulus and a message to be processed is then copied to this buffer based on their own lengths. Since the price for providing too long input data is a buffer overflow and there already

[PATCH 2/3] crypto: ccp - return an actual key size from RSA max_size callback

2018-02-24 Thread Maciej S. Szmigiero
rsa-pkcs1pad uses a value returned from a RSA implementation max_size callback as a size of an input buffer passed to the RSA implementation for encrypt and sign operations. CCP RSA implementation uses a hardware input buffer which size depends only on the current RSA key length, so it should

[PATCH 1/3] X.509: unpack RSA signatureValue field from BIT STRING

2018-02-24 Thread Maciej S. Szmigiero
The signatureValue field of a X.509 certificate is encoded as a BIT STRING. For RSA signatures this BIT STRING is of so-called primitive subtype, which contains a u8 prefix indicating a count of unused bits in the encoding. We have to strip this prefix from signature data, just as we already do

Re: [dm-devel] Integrity checking fails with Atmel SHA hw accelerator enabled

2018-02-24 Thread Gilad Ben-Yossef
Hi, I'm adding the linux crypto mailing list because it seems relevant. On Fri, Feb 23, 2018 at 2:25 PM, Gigi W wrote: > Thanks for the input! > > See below > > > On Fri, Feb 23, 2018 at 10:53 AM Gilad Ben-Yossef > wrote: >> >> On Fri, Feb 23, 2018

RE: [Crypto v7 03/12] tls: support for inline tls

2018-02-24 Thread Atul Gupta
-Original Message- From: Dave Watson [mailto:davejwat...@fb.com] Sent: Friday, February 23, 2018 11:03 PM To: Atul Gupta Cc: da...@davemloft.net; herb...@gondor.apana.org.au; s...@queasysnail.net; linux-crypto@vger.kernel.org; net...@vger.kernel.org; Ganesh GR

error in libkcapi 1.0.3 for aead aio

2018-02-24 Thread Harsh Jain
Hi Stephan, 1 of the test mentioned in test.sh is failing for AEAD AIO operation even thought driver is returning EBADMSG(as expected) to af_alg with latest cryptodev tree. Debug log and strace attached. Command : strace -o strace.log ../bin/kcapi   -x 10   -c "gcm(aes)" -i

[PATCH 5/5] crypto:chelsio:Split Hash requests for large scatter gather list

2018-02-24 Thread Harsh Jain
Send multiple WRs to H/W when No. of entries received in scatter list cannot be sent in single request. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 358 ++- drivers/crypto/chelsio/chcr_algo.h | 10 +-

[PATCH 2/5] crypto:chelsio: Fix src buffer dma length

2018-02-24 Thread Harsh Jain
ulptx header cannot have length > 64k. Adjust length accordingly. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c

[PATCH 1/5] crypto:chelsio: Use kernel round function to align lengths

2018-02-24 Thread Harsh Jain
Replace DIV_ROUND_UP to roundup or rounddown Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 73 ++ drivers/crypto/chelsio/chcr_algo.h | 1 - 2 files changed, 34 insertions(+), 40 deletions(-) diff --git

[PATCH 4/5] crypto:chelsio: Fix iv passed in fallback path for rfc3686

2018-02-24 Thread Harsh Jain
We use ctr(aes) to fallback rfc3686(ctr) request. Send updated IV to fallback path. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/chelsio/chcr_algo.c

[PATCH 3/5] crypto:chelsio: Update IV before sending request to HW

2018-02-24 Thread Harsh Jain
CBC Decryption requires Last Block as IV. In case src/dst buffer are same last block will be replaced by plain text. This patch copies the Last Block before sending request to HW. Signed-off-by: Harsh Jain --- drivers/crypto/chelsio/chcr_algo.c | 19 +++ 1

[PATCH 0/5] crypto:chelsio: Bug fixes and cleanup

2018-02-24 Thread Harsh Jain
It includes bug fixes and code cleanup. Harsh Jain (5): crypto:chelsio: Use kernel round function to align lengths crypto:chelsio: Fix src buffer dma length crypto:chelsio: Update IV before sending request ot HW crypto:chelsio: Fix iv passed in fallback path for rfc3686