From: Ben Greear <greearb@candelatech.com>
To: Christian Lamparter <chunkeey@googlemail.com>
Cc: Jouni Malinen <j@w1.fi>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
Johannes Berg <johannes@sipsolutions.net>
Subject: Re: Looking for non-NIC hardware-offload for wpa2 decrypt.
Date: Thu, 07 Aug 2014 10:45:01 -0700 [thread overview]
Message-ID: <53E3BB1D.10807@candelatech.com> (raw)
In-Reply-To: <1875618.ePecsgGYZf@blech>
On 08/07/2014 07:05 AM, Christian Lamparter wrote:
> The high overhead (math_state_restore and fpu_save_init) are caused by
> the way ccm.c interacts with the aesni implementation when calculating
> the MAC [1] (in compute_mac).
>
>> [ ... ]
>> /* now encrypt rest of data */
>> while (datalen >= 16) {
>> crypto_xor(odata, data, bs);
>> crypto_cipher_encrypt_one(tfm, odata, odata);
>>
>> datalen -= 16;
>> data += 16;
>> }
>> [...]
>
> crypto_cipher_encrypt_one is a wrapper which in your case calls
> aesni's aes_encrypt [2].
>
> And aes_encrypt looks like this:
>
>> [...]
>> kernel_fpu_begin();
>> aesni_enc(ctx, dst, src); <-- this is where it goes to _aesni_enc1
>> kernel_fpu_end();
>> [...]
>
> Or: for every 16 Bytes of payload there is one fpu context save and
> restore... ouch!
I have never messed with this kind of stuff...
Any idea if it would work to put the fpu_begin/end a bit higher and do all those 16 byte
chunks in a batch without messing with the FPU for each chunk?
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2014-08-07 17:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-31 4:40 Looking for non-NIC hardware-offload for wpa2 decrypt Ben Greear
2014-03-31 18:09 ` Christian Lamparter
2014-07-28 20:50 ` Ben Greear
2014-07-29 22:29 ` Christian Lamparter
2014-07-29 22:50 ` Ben Greear
2014-07-30 18:59 ` Christian Lamparter
2014-07-30 19:08 ` Ben Greear
2014-07-31 20:05 ` Jouni Malinen
2014-07-31 20:45 ` Christian Lamparter
2014-08-05 23:09 ` Ben Greear
2014-08-07 14:05 ` Christian Lamparter
2014-08-07 17:45 ` Ben Greear [this message]
2014-08-10 13:44 ` Christian Lamparter
2014-08-12 18:34 ` Ben Greear
2014-08-14 12:39 ` Christian Lamparter
2014-08-14 17:09 ` Ben Greear
2014-08-19 18:18 ` Ben Greear
2014-08-20 20:47 ` Christian Lamparter
2014-08-20 21:04 ` Ben Greear
2014-08-22 22:55 ` Christian Lamparter
2014-07-30 7:06 ` 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=53E3BB1D.10807@candelatech.com \
--to=greearb@candelatech.com \
--cc=chunkeey@googlemail.com \
--cc=j@w1.fi \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.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).