DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: Brad House <brad@monetra.com>
Cc: dm-crypt@saout.de
Subject: Re: [dm-crypt] Recommended modes for performance (SMP+AES-NI)
Date: Tue, 28 Jun 2011 18:41:59 +0200	[thread overview]
Message-ID: <4E0A0457.9090806@redhat.com> (raw)
In-Reply-To: <4E08B71B.5060005@monetra.com>

On 06/27/2011 07:00 PM, Brad House wrote:
>> ESSIV is only for CBC.

yes, but nothing will stop you to use it for other
mode (even if it is needed or redundant, like for XTS)

>>> At this point, I'm leaning towards CTR mode, mainly because it
>>> was designed explicitly to be parallelizable:
>>> http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Counter_.28CTR.29
>>
>> That is only for fine-grained paralellism, and hence not
>> applicable here. I am also not sure whether you can even use it
>> with dm-crypt as it needs a nonce in addition to the counter.
>> And that needs to be stored somewhere.
> 
> 
> Well, since Intel provided a specific CTR mode AES-NI patch and
> it referenced testing it _using_ dm-crypt
> (http://lwn.net/Articles/376562/), I'd assume it is possible to at
> least use it with dm-crypt ;)

You can "use" it, again - dmcrypt will not stop you when doing that.
(try e.g. -c aes-ctr-plain64 -s 128)

Internally, it should use generated IV (plain64 - sector number here)
as concatenated nonce + counter, crypto API CTR implementation
then increases counter part when walking through block device sector
using cipher block steps.

So it "works" somehow. It is not tested at all though for use
with full disk encryption:)


>> Unless you have any specific security requirements beyond
>> the standard, go with the defaults. I think you are
>> overthinking this. The defaults are what is maintained best
>> and also what will get the fastest fixes and problem detection.

Exactly. Default is still CBC mode with ESSIV,
XTS is more and more used, so it is possible that in future
XTS mode will be become default in cryptsetup.

Milan

      parent reply	other threads:[~2011-06-28 16:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-27 15:38 [dm-crypt] Recommended modes for performance (SMP+AES-NI) Brad House
2011-06-27 16:18 ` Arno Wagner
2011-06-27 17:00   ` Brad House
2011-06-27 17:35     ` Arno Wagner
2011-06-28 16:41     ` Milan Broz [this message]

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=4E0A0457.9090806@redhat.com \
    --to=mbroz@redhat.com \
    --cc=brad@monetra.com \
    --cc=dm-crypt@saout.de \
    /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