From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Netdev <netdev@vger.kernel.org>,
Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
David Miller <davem@davemloft.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Samuel Neves <sneves@dei.uc.pt>,
Andrew Lutomirski <luto@kernel.org>,
Jean-Philippe Aumasson <jeanphilippe.aumasson@gmail.com>
Subject: Re: [PATCH net-next v5 02/20] zinc: introduce minimal cryptography library
Date: Tue, 25 Sep 2018 16:44:39 +0200 [thread overview]
Message-ID: <CAHmME9oG6HSUV+UcohTbnt2VxVR8CQ2vFOZ8JSPb_uCoYcuy+g@mail.gmail.com> (raw)
In-Reply-To: <CAKv+Gu_Wsp7s31KowyA20ag4t=VyiPLLhzg1ySp31sOFvo7FQQ@mail.gmail.com>
Hey Ard,
On Tue, Sep 25, 2018 at 12:25 PM Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
> Kees is currently dealing with VLA uses in crypto API skcipher
> invocations [0] that don't benefit from its async capabilities nor
> from the runtime resolution of cipher name strings, given that they
> always select the same one.
>
> drivers/net/ppp/ppp_mppe.c: "ecb(arc4)"
> drivers/usb/wusbcore/crypto.c: "cbc(aes)"
> net/ceph/crypto.c: "cbc(aes)"
> net/mac802154/llsec.c: "ctr(aes)"
> net/rxrpc/rxkad.c: "pcbc(fcrypt)"
> net/rxrpc/rxkad.c: "pcbc(fcrypt)"
> net/sunrpc/auth_gss/gss_krb5_mech.c: "cbc(des)"
> net/sunrpc/auth_gss/gss_krb5_mech.c: "ecb(arc4)"
> net/sunrpc/auth_gss/gss_krb5_mech.c: "cbc(des3_ede)"
> net/sunrpc/auth_gss/gss_krb5_mech.c: "cts(cbc(aes))"
> net/sunrpc/auth_gss/gss_krb5_mech.c: "cts(cbc(aes))"
> net/wireless/lib80211_crypt_tkip.c: "ecb(arc4)"
> net/wireless/lib80211_crypt_wep.c: "ecb(arc4)"
>
> To me, these are prime candidates for moving into your library [at
> some point]. I guess AES should be non-controversial, but moving the
> others is actually more important in my view, since we will be able to
> stop exposing them via the crypto API in that case. Any thoughts?
In order of priority, I'll probably tackle lib/ first and then the
cases like you mentioned after. Indeed AES is an obvious candidate.
For the others, we'll evaluate them on a case-by-case basis. For
example, Ted T'so's "halfmd4" algorithm was moved from lib/ directly
into that portion of the ext4 driver, since it's some "half"-baked
random crypto that should only be used in that one place and then
never again. On the other hand, it seems likely RC4 and DES are used
multiple places, and so we'll have to carefully evaluate these. We can
also discuss this in November and see where thoughts are at that time.
> Also, you haven't yet responded to my question about WireGuard's
> limitation to synchronous encryption, or whether and how you expect to
> support asynchronous accelerators for ChaCha20/Poly1305 in the future.
> This shouldn't impede adoption of this series, but this is something
> that is going to come up sooner than you think, and so I would like to
> understand whether this means your library will grow asynchronous
> interfaces as well, or whether it will be moved to the crypto API.
I have no concrete plans to introduce an asynchronous interface to
Zinc at this time, but that could change at some later date. At the
moment however, I prefer for it to be just a simple collection of
software ciphers, just as the description reads. Regarding hardware
acceleration in WireGuard: I've actually been talking to some people
interested in producing these types of ASICs lately, and hopefully
something cool will come out of it. It's not obvious, however, that
this _must_ imply an asynchronous interface, even though that may very
well seem like the intuitive thing. This is, as well, a discussion for
the future indeed.
> (Also, I'd like to know whether the RFC7539 construction of ChaCha20
> and Poly1305 is compatible with WireGuard's)
WireGuard uses 64-bit nonces, but since they're both little-endian,
and because of the maximum size of a series of IP fragments (namely,
less than 2^32), they're "compatible".
Jason
next prev parent reply other threads:[~2018-09-25 14:44 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-18 16:16 [PATCH net-next v5 00/20] WireGuard: Secure Network Tunnel Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 01/20] asm: simd context helper API Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 02/20] zinc: introduce minimal cryptography library Jason A. Donenfeld
2018-09-20 15:41 ` Ard Biesheuvel
2018-09-20 16:01 ` Andy Lutomirski
2018-09-20 16:02 ` Arnd Bergmann
2018-09-21 0:11 ` Jason A. Donenfeld
2018-09-21 3:12 ` Andrew Lunn
2018-09-21 3:16 ` Jason A. Donenfeld
2018-09-21 3:23 ` Andy Lutomirski
2018-09-21 4:15 ` Jason A. Donenfeld
2018-09-21 4:30 ` Ard Biesheuvel
2018-09-21 4:32 ` Jason A. Donenfeld
2018-09-21 4:52 ` Andy Lutomirski
2018-09-22 16:11 ` Arnd Bergmann
2018-09-25 7:18 ` Arnd Bergmann
2018-09-25 14:29 ` Jason A. Donenfeld
2018-09-21 0:17 ` Jason A. Donenfeld
2018-09-25 10:25 ` Ard Biesheuvel
2018-09-25 14:44 ` Jason A. Donenfeld [this message]
2018-09-18 16:16 ` [PATCH net-next v5 03/20] zinc: ChaCha20 generic C implementation and selftest Jason A. Donenfeld
2018-09-19 1:08 ` Eric Biggers
2018-09-19 2:02 ` Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 04/20] zinc: ChaCha20 x86_64 implementation Jason A. Donenfeld
2018-09-18 22:29 ` Thomas Gleixner
2018-09-19 2:14 ` Jason A. Donenfeld
2018-09-19 6:13 ` Thomas Gleixner
2018-09-19 11:33 ` Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 05/20] zinc: ChaCha20 ARM and ARM64 implementations Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 06/20] zinc: ChaCha20 MIPS32r2 implementation Jason A. Donenfeld
2018-09-18 20:25 ` Paul Burton
2018-09-20 13:19 ` Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 07/20] zinc: Poly1305 generic C implementations and selftest Jason A. Donenfeld
2018-09-19 0:50 ` Eric Biggers
2018-09-19 1:35 ` Jason A. Donenfeld
2018-09-19 4:13 ` Andy Lutomirski
2018-09-19 11:50 ` Jason A. Donenfeld
2018-09-19 12:26 ` Jason A. Donenfeld
2018-09-19 1:39 ` Jason A. Donenfeld
2018-09-19 1:41 ` Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 08/20] zinc: Poly1305 x86_64 implementation Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 09/20] zinc: Poly1305 ARM and ARM64 implementations Jason A. Donenfeld
2018-09-18 22:55 ` Eric Biggers
2018-09-19 0:17 ` Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 10/20] zinc: Poly1305 MIPS32r2 and MIPS64 implementations Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 11/20] zinc: ChaCha20Poly1305 construction and selftest Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 12/20] zinc: BLAKE2s generic C implementation " Jason A. Donenfeld
2018-09-19 0:41 ` Eric Biggers
2018-09-19 0:45 ` Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 13/20] zinc: BLAKE2s x86_64 implementation Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 14/20] zinc: Curve25519 generic C implementations and selftest Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 15/20] zinc: Curve25519 x86_64 implementation Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 16/20] zinc: Curve25519 ARM implementation Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 17/20] crypto: port Poly1305 to Zinc Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 18/20] crypto: port ChaCha20 " Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 19/20] security/keys: rewrite big_key crypto to use Zinc Jason A. Donenfeld
2018-09-18 16:16 ` [PATCH net-next v5 20/20] net: WireGuard secure network tunnel Jason A. Donenfeld
2018-09-18 23:34 ` Andrew Lunn
2018-09-19 2:04 ` Jason A. Donenfeld
2018-09-19 12:38 ` Andrew Lunn
2018-09-18 17:01 ` [PATCH net-next v5 19/20] security/keys: rewrite big_key crypto to use Zinc David Howells
2018-09-18 17:12 ` Jason A. Donenfeld
2018-09-18 18:28 ` [PATCH net-next v5 00/20] WireGuard: Secure Network Tunnel Ard Biesheuvel
2018-09-18 21:01 ` Jason A. Donenfeld
2018-09-19 17:21 ` Ard Biesheuvel
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=CAHmME9oG6HSUV+UcohTbnt2VxVR8CQ2vFOZ8JSPb_uCoYcuy+g@mail.gmail.com \
--to=jason@zx2c4.com \
--cc=ard.biesheuvel@linaro.org \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=jeanphilippe.aumasson@gmail.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sneves@dei.uc.pt \
/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).