From: Tadeusz Struk <tadeusz.struk@intel.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: linux-crypto@vger.kernel.org, qat-linux@intel.com,
pingchao.yang@intel.com, davem@davemloft.net
Subject: Re: [PATCH v2 3/3] crypto: qat - Add support for RSA algorithm
Date: Wed, 15 Jul 2015 08:05:35 -0700 [thread overview]
Message-ID: <55A676BF.3090500@intel.com> (raw)
In-Reply-To: <20150715130333.GA2006@gondor.apana.org.au>
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 issue with reqsize since your fallback's reqsize
> may be bigger than yours. You'll need to change akcipher first
> to move the reqsize field into crypto_akcipher. Then you can
> set the reqsize here.
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 smaller than mine. What do you think?
>
>> > + ret = mpi_read_buffer(pkey->n, ctx->n, ctx->key_sz, &len, NULL);
>> > + if (ret)
>> > + goto free_d;
> Huh? Why are you converting in and out of MPI? If the hardware wants
> raw integers, then you should just give the raw numbers to it.
The rsa_parse_key helper in the rsa generic that parses the key in BER format
produces the MPIs.I didn't want to add yet another BER parser here. Should I?
next prev parent reply other threads:[~2015-07-15 15:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-14 18:32 [PATCH v2 0/3] crypto: qat - add RSA support to qat driver Tadeusz Struk
2015-07-14 18:32 ` [PATCH v2 1/3] crypto: qat - add support for MMP FW Tadeusz Struk
2015-07-14 18:32 ` [PATCH v2 2/3] crypto: qat - add MMP FW support to accel engine Tadeusz Struk
2015-07-14 18:33 ` [PATCH v2 3/3] crypto: qat - Add support for RSA algorithm Tadeusz Struk
2015-07-15 13:03 ` Herbert Xu
2015-07-15 15:05 ` Tadeusz Struk [this message]
2015-07-15 15:09 ` Herbert Xu
2015-07-15 15:14 ` Tadeusz Struk
2015-07-15 15:16 ` Herbert Xu
2015-07-15 15:19 ` Tadeusz Struk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55A676BF.3090500@intel.com \
--to=tadeusz.struk@intel.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=pingchao.yang@intel.com \
--cc=qat-linux@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).