From: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
To: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: "<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>"
<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Sergey Senozhatsky
<sergey.senozhatsky.work-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
"<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>"
<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Herbert Xu
<herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org>
Subject: Re: [PATCH v4] mac80211: move extra crypto data off the stack
Date: Mon, 17 Oct 2016 11:23:46 +0200 [thread overview]
Message-ID: <1476696226.19992.13.camel@sipsolutions.net> (raw)
In-Reply-To: <CAKv+Gu-aZhCBvnEQoZUZLDPXCrvgxO1pSd=6EHz+tMB+dFz5hg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> (sfid-20161017_111430_166768_740CD0F3)
> Apologies for going back and forth on this, but it appears there may
> be another way to deal with this.
>
> First of all, we only need this handling for the authenticated data,
Are you sure b_0/j_0 aren't needed? We pass those
to aead_request_set_crypt(), and I wasn't sure what that really did
internally, perhaps like the internal data.
Testing with that on the stack does seem to work, in fact.
Surely we need zero for GMAC though, since we also put that into the sg
list. Thus for GMAC we definitely need 20+16 bytes, and since I round
up to a cacheline (at least on SMP) it doesn't really matter that we
could get 36 instead of the 48 I have now.
> and only for CCM and GCM, not CMAC (which does not use scatterlists
> at all, it simply calls the AES cipher directly)
I didn't modify CMAC, I think, only GMAC, which also uses scatterlists.
> So that leaves a fixed 20 bytes for GCM and fixed 32 bytes for CCM,
and 36 for GMAC :)
johannes
next prev parent reply other threads:[~2016-10-17 9:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-17 8:33 [PATCH v4] mac80211: move extra crypto data off the stack Johannes Berg
2016-10-17 9:14 ` Ard Biesheuvel
2016-10-17 9:17 ` Ard Biesheuvel
[not found] ` <CAKv+Gu-aZhCBvnEQoZUZLDPXCrvgxO1pSd=6EHz+tMB+dFz5hg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-17 9:23 ` Johannes Berg [this message]
2016-10-17 9:30 ` Ard Biesheuvel
[not found] ` <CAKv+Gu_ZH9hO_xbVfOfk90CxFJ6ZTz3PKWB1v23LRVzpBrb=oQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-17 9:35 ` Johannes Berg
[not found] ` <1476696918.19992.15.camel-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2016-10-17 9:49 ` Ard Biesheuvel
2016-10-17 9:52 ` Ard Biesheuvel
[not found] ` <67161BCC-596E-4DDE-A58E-9195BB5570C2-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-10-17 9:54 ` Johannes Berg
2016-10-17 10:02 ` Ard Biesheuvel
[not found] ` <41D0AC2F-E86E-4A98-AD8B-1239D7E6123A-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-10-17 13:06 ` Ard Biesheuvel
2016-10-17 13:16 ` Johannes Berg
[not found] ` <1476710169.315.1.camel-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2016-10-17 13:20 ` Ard Biesheuvel
2016-10-17 13:25 ` 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=1476696226.19992.13.camel@sipsolutions.net \
--to=johannes-cdvu00un1vgdhxzaddlk8q@public.gmane.org \
--cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=herbert-lOAM2aK0SrRLBo1qDEOMRrpzq4S04n8Q@public.gmane.org \
--cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sergey.senozhatsky.work-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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).