From: Johannes Berg <johannes@sipsolutions.net>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
luto@amacapital.net, sergey.senozhatsky.work@gmail.com,
netdev@vger.kernel.org, herbert@gondor.apana.org.au,
davem@davemloft.net, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org, j@w1.fi
Subject: Re: [PATCH] crypto: ccm - avoid scatterlist for MAC encryption
Date: Mon, 17 Oct 2016 09:28:30 +0200 [thread overview]
Message-ID: <1476689310.19992.1.camel@sipsolutions.net> (raw)
In-Reply-To: <1476551776-8099-1-git-send-email-ard.biesheuvel@linaro.org> (sfid-20161015_191624_228877_FEFB7F65)
On Sat, 2016-10-15 at 18:16 +0100, Ard Biesheuvel wrote:
> The CCM code goes out of its way to perform the CTR encryption of the
> MAC using the subordinate CTR driver. To this end, it tweaks the
> input and output scatterlists so the aead_req 'odata' and/or
> 'auth_tag' fields [which may live on the stack] are prepended to the
> CTR payload. This involves calling sg_set_buf() on addresses which
> are not direct mapped, which is not supported.
> Since the calculation of the MAC keystream involves a single call
> into the cipher, to which we have a handle already given that the
> CBC-MAC calculation uses it as well, just calculate the MAC keystream
> directly, and record it in the aead_req private context so we can
> apply it to the MAC in cypto_ccm_auth_mac(). This greatly simplifies
> the scatterlist manipulation, and no longer requires scatterlists to
> refer to buffers that may live on the stack.
No objection from me, Herbert?
I'm getting a bit nervous though - I'd rather have any fix first so
people get things working again - so maybe I'll apply your other patch
and mine first, and then we can replace yours by this later.
johannes
next prev parent reply other threads:[~2016-10-17 7:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-15 17:16 [PATCH] crypto: ccm - avoid scatterlist for MAC encryption Ard Biesheuvel
2016-10-17 7:28 ` Johannes Berg [this message]
2016-10-17 7:37 ` Ard Biesheuvel
2016-10-17 7:47 ` Johannes Berg
2016-10-17 7:50 ` Ard Biesheuvel
2016-10-17 7:57 ` Johannes Berg
2016-10-17 17:08 ` Andy Lutomirski
2016-10-17 17:21 ` Ard Biesheuvel
[not found] ` <CAKv+Gu-25OvTSbyE06Ln8N+HsqNyV1T6oOudK2tyAAOmmXXqgA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-19 3:31 ` Herbert Xu
2016-10-19 7:43 ` Johannes Berg
2016-10-19 15:08 ` Ard Biesheuvel
2016-10-19 15:59 ` Ben Greear
2016-10-19 16:00 ` Johannes Berg
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=1476689310.19992.1.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=ard.biesheuvel@linaro.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=j@w1.fi \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=netdev@vger.kernel.org \
--cc=sergey.senozhatsky.work@gmail.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).