[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1476689310.19992.1.camel@sipsolutions.net>
Date: Mon, 17 Oct 2016 09:28:30 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Ard Biesheuvel <ard.biesheuvel@...aro.org>, luto@...capital.net,
sergey.senozhatsky.work@...il.com, netdev@...r.kernel.org,
herbert@...dor.apana.org.au, davem@...emloft.net,
linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
j@...fi
Subject: Re: [PATCH] crypto: ccm - avoid scatterlist for MAC encryption
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
Powered by blists - more mailing lists