crypto: chacha20poly1305 - Convert to new AEAD interface

2015-07-15 Thread Herbert Xu
This patch converts rfc7539 and rfc7539esp to the new AEAD interface. The test vectors for rfc7539esp have also been updated to include the IV. Signed-off-by: Herbert Xu --- crypto/chacha20poly1305.c | 213 +++--- crypto/testmgr.h | 10 +- 2 f

[PATCH v3 4/4] crypto: rsa - limit supported key lengths

2015-07-15 Thread Tadeusz Struk
Introduce constrains for RSA keys lengths. Only key lengths of 512, 1024, 1536, 2048, 3072, and 4096 bits will be supported. Signed-off-by: Tadeusz Struk --- crypto/rsa.c | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/crypto/rsa.c b/crypto/rsa.c

[PATCH v3 3/4] crypto: qat - Add support for RSA algorithm

2015-07-15 Thread Tadeusz Struk
Add RSA support to QAT driver. Removed unused RNG rings. Signed-off-by: Tadeusz Struk --- drivers/crypto/qat/Kconfig |2 drivers/crypto/qat/qat_common/.gitignore |1 drivers/crypto/qat/qat_common/Makefile |5 drivers/crypto/qat/qat_common/adf_comm

[PATCH v3 2/4] crypto: qat - add MMP FW support to accel engine

2015-07-15 Thread Tadeusz Struk
Add code that loads the MMP firmware Signed-off-by: Tadeusz Struk --- drivers/crypto/qat/qat_common/adf_accel_devices.h |2 + drivers/crypto/qat/qat_common/adf_accel_engine.c | 42 ++-- .../crypto/qat/qat_dh895xcc/adf_dh895xcc_hw_data.c |1 .../crypto/qat/qat_dh895x

[PATCH v3 1/4] crypto: qat - add support for MMP FW

2015-07-15 Thread Tadeusz Struk
From: Pingchao Yang Load Modular Math Processor(MMP) firmware into QAT devices to support public key algorithm acceleration. Signed-off-by: Pingchao Yang Signed-off-by: Tadeusz Struk --- drivers/crypto/qat/qat_common/adf_accel_devices.h |1 + drivers/crypto/qat/qat_common/adf_common_drv.

[PATCH v3 0/4] crypto: qat - add RSA support to qat driver

2015-07-15 Thread Tadeusz Struk
This series adds RSA support to the qat driver. First patch adds the logic in FW loader to load the Modular Math Processor(MMP) firmware to the device's internal memory. Second patch adds logic to load MMP firmware from disk. Third patch adds the actual RSA implementation. It also contains minor cl

Re: [PATCH v2 3/3] crypto: qat - Add support for RSA algorithm

2015-07-15 Thread Tadeusz Struk
On 07/15/2015 08:16 AM, Herbert Xu wrote: >> Are you ok if I just add the same constrains to rsa-generic? > Yes that would work. Of course if any future hardware implementation > wanted to support other key sizes we'd have to add a fallback to qat. That's ok. I like the lazy approach for now. Tha

Re: [PATCH v2 3/3] crypto: qat - Add support for RSA algorithm

2015-07-15 Thread Herbert Xu
On Wed, Jul 15, 2015 at 08:14:51AM -0700, Tadeusz Struk wrote: > On 07/15/2015 08:09 AM, Herbert Xu wrote: > >> This is even more complicated because the user can first allocate request > >> > and then call setkey causing fallback. I'm now thinking about adding the > >> > limitation to rsa generic

Re: [PATCH v2 3/3] crypto: qat - Add support for RSA algorithm

2015-07-15 Thread Tadeusz Struk
On 07/15/2015 08:09 AM, Herbert Xu wrote: >> This is even more complicated because the user can first allocate request >> > and then call setkey causing fallback. I'm now thinking about adding the >> > limitation to rsa generic or I can still use rsa-generic which I know that >> > its ctx is smalle

Re: [PATCH v2 3/3] crypto: qat - Add support for RSA algorithm

2015-07-15 Thread Herbert Xu
On Wed, Jul 15, 2015 at 08:05:35AM -0700, Tadeusz Struk wrote: > > This is even more complicated because the user can first allocate request > and then call setkey causing fallback. I'm now thinking about adding the > limitation to rsa generic or I can still use rsa-generic which I know that > its

Re: [PATCH v2 3/3] crypto: qat - Add support for RSA algorithm

2015-07-15 Thread Tadeusz Struk
On 07/15/2015 06:03 AM, Herbert Xu wrote: >> +ctx->fallback = crypto_alloc_akcipher("rsa-generic", 0, 0); > You need to set CRYPTO_ALG_NEED_FALLBACK in the mask here. You > should also set it in your cra_flags. Then you can have rsa here > instead of rsa-generic. > > There is also an

Re: [PATCH 6/6] nx-842-platform: if NX842 platform drivers are not modules, don't try to load them

2015-07-15 Thread Dan Streetman
On Mon, Jul 6, 2015 at 1:07 PM, Nishanth Aravamudan wrote: > On 06.07.2015 [16:13:07 +0800], Herbert Xu wrote: >> On Thu, Jul 02, 2015 at 03:42:26PM -0700, Nishanth Aravamudan wrote: >> > Based off the CONFIG_SPU_FS_MODULE code, only attempt to load platform >> > modules if the nx-842 pseries/powe

Re: [PATCH 5/6] [RFC] crypto/testmgr: add null test for 842 algorithm

2015-07-15 Thread Dan Streetman
On Mon, Jul 13, 2015 at 8:05 PM, Nishanth Aravamudan wrote: > On 13.07.2015 [17:05:36 -0700], Nishanth Aravamudan wrote: >> On 04.07.2015 [15:24:53 +0800], Herbert Xu wrote: >> > On Thu, Jul 02, 2015 at 03:41:19PM -0700, Nishanth Aravamudan wrote: >> > > Currently, when the nx-842-pseries driver l

Re: [PATCH v2 3/3] crypto: qat - Add support for RSA algorithm

2015-07-15 Thread Herbert Xu
On Tue, Jul 14, 2015 at 11:33:00AM -0700, Tadeusz Struk wrote: > > +static void qat_rsa_cb(struct icp_qat_fw_pke_resp *resp) > +{ > + struct akcipher_request *areq = (void *)(__force long)resp->opaque; > + struct qat_rsa_request *req = PTR_ALIGN(akcipher_request_ctx(areq), 64); You need to