Re: crypto: qat - Add support for RSA algorithm

2015-07-20 Thread Dan Carpenter
On Mon, Jul 20, 2015 at 09:13:32AM -0700, Tadeusz Struk wrote: > On 07/20/2015 08:12 AM, Dan Carpenter wrote: > > The patch a990532023b9: "crypto: qat - Add support for RSA algorithm" > > from Jul 15, 2015, leads to the following Smatch warning: > > > &

Re: crypto: qat - Add support for RSA algorithm

2015-07-20 Thread Tadeusz Struk
On 07/20/2015 08:12 AM, Dan Carpenter wrote: > The patch a990532023b9: "crypto: qat - Add support for RSA algorithm" > from Jul 15, 2015, leads to the following Smatch warning: > > drivers/crypto/qat/qat_common/qat_asym_algs.c:446 qat_rsa_get_n() > warn: was

Re: crypto: qat - Add support for RSA algorithm

2015-07-20 Thread Dan Carpenter
Also: drivers/crypto/qat/qat_common/qat_asym_algs.c:513 qat_rsa_get_d() warn: was && intended here instead of ||? regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.kernel.org More majordomo

re: crypto: qat - Add support for RSA algorithm

2015-07-20 Thread Dan Carpenter
Hello Tadeusz Struk, The patch a990532023b9: "crypto: qat - Add support for RSA algorithm" from Jul 15, 2015, leads to the following Smatch warning: drivers/crypto/qat/qat_common/qat_asym_algs.c:446 qat_rsa_get_n() warn: was && intended here instead of ||?

[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

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

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

2015-07-14 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/Makefile |1 drivers/crypto/qat/qat_common/adf_common_drv.h | 10 drivers/crypto/qat/qat_common/adf_init

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

2015-07-14 Thread Tadeusz Struk
On 07/13/2015 11:46 PM, Herbert Xu wrote: > As we discussed a while ago, the hardware implementation must not > support a smaller feature set than the software implementation. > > So please either add a software fallback for unsupported key sizes, > or ensure that the software implementation also

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

2015-07-13 Thread Herbert Xu
On Fri, Jul 10, 2015 at 10:06:32AM -0700, Tadeusz Struk wrote: > > + ctx->key_sz = mpi_get_size(pkey->n); > + if (!qat_rsa_enc_fn_id(ctx->key_sz)) { > + /* invalid key size provided */ > + rsa_free_key(pkey); > + ctx->key_sz = 0; > + return -E

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

2015-07-10 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/Makefile |1 drivers/crypto/qat/qat_common/adf_common_drv.h | 10 drivers/crypto/qat/qat_common/adf_init