From: Tudor Ambarus <tudor.ambarus@microchip.com>
To: Marcel Holtmann <marcel@holtmann.org>,
Stephan Mueller <smueller@chronox.de>
Cc: Mat Martineau <mathew.j.martineau@linux.intel.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
<dhowells@redhat.com>
Subject: Re: [PATCH v8 0/4] crypto: add algif_akcipher user space API
Date: Thu, 17 Aug 2017 16:17:34 +0300 [thread overview]
Message-ID: <92b13089-acbf-6cf9-6e03-24a3b58a4f41@microchip.com> (raw)
In-Reply-To: <1E882887-3F56-4A4C-AADF-2F25F4D3A7C9@holtmann.org>
Hi, all,
On 08/11/2017 07:05 PM, Marcel Holtmann wrote:
> Hi Stephan,
>
>>> AF_ALG is best suited for crypto use cases where a socket is set up once
>>> and there are lots of reads and writes to justify the setup cost. With
>>> asymmetric crypto, the setup cost is high when you might only use the
>>> socket for a brief time to do one verify or encrypt operation.
>>
>> To me, the entire AF_ALG purpose is solely to export hardware support to user
>> space. That said, if user space wants an accelerator, a socket would be opened
>> once followed by numerous read/write requests.
>>
>> Besides, I am aware of Tadeusz' patch to link algif_akcipher to the keyring
>> and I planned to port it to the current implementation. But I thought I offer
>> a small patch focusing on the externalization of the akcipher API first.
>>
>> I think the keyctl and AF_ALG are no opponents, but rather are orthogonal to
>> each other. The statement I made for the KPP AF_ALG RFC applies here too:
>>
>> """
>> I am aware and in fact supported development of the DH support in the keys
>> subsystem. The question will be raised whether the AF_ALG KPP interface is
>> superfluous in light of the keys DH support. My answer is that AF_ALG KPP is
>> orthogonal to the keys DH support. The keys DH support use case is that
>> the keys are managed inside the kernel and thus has the focus on the
>> key management. Contrary, AF_ALG KPP does not really focus on key management
>> but simply externalizes the DH/ECDH support found in the kernel including
>> hardware acceleration. User space is in full control of the key life cycle.
>> This way, AF_ALG could be used to complement user-space network protocol
>> implementations like TLS or IKE to offload the resource intense DH
>> calculations to accelerators.
>> “""
>
> we do not need two interfaces for doing the same thing. Especially not one that can not handle hardware backed keys. And more important if you can not abstract an accelerator that doesn’t expose the private key at all.
I'm working with a crypto accelerator (find it at [1]) that is capable
of generating random ecc private keys internally within the device that
are never revealed outside of it. The keys can be further used for ECDH
and ECDSA.
The simplest way to access my device from user-space is to go through
af_alg. We can permit the users to provide NULL keys, and if so, we can
generate the keys inside the kernel/hardware. If hardware supports
key generation and retention, it will use it, else the keys
will be generated inside the kernel. Either way it's a win, we don't
reveal the private keys to user-space. Going through the keyring
subsystem seems superfluous in this case.
My use case compared with the one of using keyring subsystem to access
keys from TPMs or Intel's sgx enclave seem orthogonal. What do you
think?
Cheers,
ta
[1] http://www.microchip.com/wwwproducts/en/ATECC508A
The driver can be found in drivers/crypto/atmel-ecc* in Herbert's tree.
next prev parent reply other threads:[~2017-08-17 13:18 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-10 6:39 [PATCH v8 0/4] crypto: add algif_akcipher user space API Stephan Müller
2017-08-10 6:39 ` [PATCH v8 1/4] crypto: AF_ALG -- add sign/verify API Stephan Müller
2017-08-10 12:49 ` Tudor Ambarus
2017-08-10 13:03 ` Stephan Mueller
2017-08-10 13:59 ` Tudor Ambarus
2017-08-10 14:06 ` Stephan Müller
2017-08-10 6:39 ` [PATCH v8 2/4] crypto: AF_ALG -- add setpubkey setsockopt call Stephan Müller
2017-08-10 6:40 ` [PATCH v8 3/4] crypto: AF_ALG -- add asymmetric cipher Stephan Müller
2017-08-11 12:51 ` Tudor Ambarus
2017-08-19 13:53 ` Stephan Müller
2017-08-21 8:55 ` Tudor Ambarus
2017-08-21 9:23 ` Tudor Ambarus
2017-08-21 9:39 ` Stephan Mueller
2017-08-10 6:40 ` [PATCH v8 4/4] crypto: algif_akcipher - enable compilation Stephan Müller
2017-08-11 12:56 ` Tudor Ambarus
2017-08-11 13:03 ` Stephan Mueller
2017-08-11 0:48 ` [PATCH v8 0/4] crypto: add algif_akcipher user space API Mat Martineau
2017-08-11 5:13 ` Marcel Holtmann
2017-08-11 6:30 ` Stephan Müller
2017-08-11 16:02 ` Marcel Holtmann
2017-08-14 6:24 ` Stephan Mueller
2017-08-14 6:42 ` Marcel Holtmann
2017-08-11 7:18 ` Stephan Mueller
2017-08-11 16:05 ` Marcel Holtmann
2017-08-13 8:52 ` Gilad Ben-Yossef
2017-08-14 6:01 ` Stephan Mueller
2017-08-17 13:17 ` Tudor Ambarus [this message]
2017-08-30 6:15 ` Tudor Ambarus
2017-08-30 7:21 ` Marcel Holtmann
2017-08-30 8:17 ` Tudor Ambarus
2017-08-30 12:36 ` Marcel Holtmann
2017-08-11 10:18 ` Andrew Zaborowski
2017-08-11 19:43 ` Mat Martineau
2017-08-14 6:03 ` Stephan Mueller
2017-08-14 6:26 ` Marcel Holtmann
2017-08-14 7:23 ` Stephan Mueller
2017-08-14 9:26 ` Marcel Holtmann
2017-10-02 14:15 ` Tudor Ambarus
2017-10-03 0:09 ` Mat Martineau
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=92b13089-acbf-6cf9-6e03-24a3b58a4f41@microchip.com \
--to=tudor.ambarus@microchip.com \
--cc=dhowells@redhat.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=mathew.j.martineau@linux.intel.com \
--cc=smueller@chronox.de \
/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