From: "Horia Geantă" <horia.geanta@freescale.com>
To: Tadeusz Struk <tadeusz.struk@intel.com>, <herbert@gondor.apana.org.au>
Cc: <corbet@lwn.net>, <keescook@chromium.org>, <qat-linux@intel.com>,
<jwboyer@redhat.com>, <richard@nod.at>, <d.kasatkin@samsung.com>,
<linux-kernel@vger.kernel.org>, <steved@redhat.com>,
<dhowells@redhat.com>, <vgoyal@redhat.com>,
<james.l.morris@oracle.com>, <jkosina@suse.cz>,
<zohar@linux.vnet.ibm.com>, <davem@davemloft.net>,
<jdelvare@suse.de>, <linux-crypto@vger.kernel.org>
Subject: Re: [PATCH RFC 0/2] crypto: Introduce Public Key Encryption API
Date: Wed, 6 May 2015 14:31:32 +0300 [thread overview]
Message-ID: <5549FB94.6020601@freescale.com> (raw)
In-Reply-To: <5547D9A3.9060800@intel.com>
On 5/4/2015 11:42 PM, Tadeusz Struk wrote:
> Hi Horia,
> On 05/04/2015 06:16 AM, Horia Geantă wrote:
>>> int (*sign)(struct pke_request *pkereq);
>>>> int (*verify)(struct pke_request *pkereq);
>>>> int (*encrypt)(struct pke_request *pkereq);
>>>> int (*decrypt)(struct pke_request *pkereq);
>> Where would be the proper place for keygen operation?
>
> This will need to be extended to support keygen.
>
>>
>> AFAICT algorithms currently map to primitives + encoding methods, which
>> is not flexible. For e.g. current RSA implementation hardcodes the
>> PKCS1-v1_5 encoding method, making it hard to add OAEP(+) etc.
>>
>> One solution would be to map algorithms to primitives only. Encoding
>> methods need to be abstracted somehow, maybe using templates to wrap the
>> algorithms.
>
> So far there is only one rsa implementation in kernel and it is only used
> by module signing code.
> Later we can add templates or simply one can register "oaep-rsa" algorithm.
I am thinking that it would be more logical for "rsa" to represent only
the *primitives*, for e.g. RSASP1, RSAVP1, RSAEP, RSADP (in rfc3447
terminology).
Then pkcs1_v15(rsa), oaep(rsa), pss(rsa) (i.e. RSAES-PKCS1-v1_5,
RSAES-OAEP, RSASSA-PSS encryption and/or signature schemes) would share
the primitives implementation, the only thing that would differ being
the encoding/padding method.
This is similar to symmetric ciphers convention of having the mode
defined as a wrapper: we have cbc(aes), ctr(aes), gcm(aes) and not
cbc-aes, ctr-aes, gcm-aes.
Another thing to consider is that there might be crypto engines which
are able to perform only "textbook" rsa. This would allow for the
primitives to be offloaded, while the encoding methods would be
performed in SW.
Thanks,
Horia
prev parent reply other threads:[~2015-05-06 11:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-30 22:36 [PATCH RFC 0/2] crypto: Introduce Public Key Encryption API Tadeusz Struk
2015-04-30 22:36 ` [PATCH RFC 1/2] crypto: add PKE API Tadeusz Struk
2015-04-30 22:43 ` Herbert Xu
2015-04-30 23:04 ` Tadeusz Struk
2015-05-01 7:24 ` Stephan Mueller
2015-05-01 17:30 ` Tadeusz Struk
2015-05-01 16:04 ` David Howells
2015-05-01 18:17 ` Tadeusz Struk
2015-05-03 0:07 ` Herbert Xu
2015-05-04 19:26 ` Tadeusz Struk
2015-05-05 1:33 ` Herbert Xu
2015-04-30 22:36 ` [PATCH RFC 2/2] crypto: RSA: KEYS: convert rsa and public key to new " Tadeusz Struk
2015-05-01 16:21 ` David Howells
2015-05-01 19:27 ` Tadeusz Struk
2015-05-01 8:47 ` [PATCH RFC 0/2] crypto: Introduce Public Key Encryption API Jean Delvare
2015-05-01 17:32 ` Tadeusz Struk
2015-05-01 15:53 ` David Howells
2015-05-04 13:16 ` Horia Geantă
2015-05-04 20:42 ` Tadeusz Struk
2015-05-06 11:31 ` Horia Geantă [this message]
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=5549FB94.6020601@freescale.com \
--to=horia.geanta@freescale.com \
--cc=corbet@lwn.net \
--cc=d.kasatkin@samsung.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=herbert@gondor.apana.org.au \
--cc=james.l.morris@oracle.com \
--cc=jdelvare@suse.de \
--cc=jkosina@suse.cz \
--cc=jwboyer@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=qat-linux@intel.com \
--cc=richard@nod.at \
--cc=steved@redhat.com \
--cc=tadeusz.struk@intel.com \
--cc=vgoyal@redhat.com \
--cc=zohar@linux.vnet.ibm.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).