From: Richard Zidlicky <rz@linux-m68k.org>
To: Max Vozeler <max@hinterhof.net>
Cc: Milan Broz <mbroz@redhat.com>,
linux-crypto@vger.kernel.org, linux-crypto@nl.linux.org,
Jari Ruusu <jariruusu@users.sourceforge.net>,
Alasdair G Kergon <agk@redhat.com>
Subject: Re: [PATCH 1/4] dm-crypt: clarify cipher vs. cipher mode
Date: Mon, 11 Jan 2010 22:28:39 +0100 [thread overview]
Message-ID: <20100111212839.GA29008@linux-m68k.org> (raw)
In-Reply-To: <20100104152542.GA5388@quark.vpn.nusquama.org>
On Mon, Jan 04, 2010 at 04:25:42PM +0100, Max Vozeler wrote:
> +
> +These modes have two main characteristics compared to regular CBC
> +with sector IV. The first is implemented in dm-crypt, the second
> +is implemented in the lmk2 and lmk3 blkciphers.
the formulation is not very clear. Possibly better wording -
+ There are two main differences distinguishing the lmk2 and lmk3 modes
+ from the blok cipher implemented in dm-crypt:
> +1) Use of 64 independent keys which are alternatingly applied to
> +different sectors.
> +
> + key = keys[sectornum % 64]
not really "alternating" when there is more than 2, my try
"different sectors are encrypted with 64 independent keys selected by the
following rule"
+ key = keys[sectornum % 64]
> +2) IV derivation from an MD5 digest of the sector number, parts
> +of the plaintext data and a mode specific format constant. The
> +multi-key-v3 mode additionally uses a 128-bit IV seed.
slightly rephrased:
+2) IVs are derived from an MD5 digest of the sector number, parts
+of the plaintext data and a mode specific format constant. The
+multi-key-v3 mode additionally uses a 128-bit IV seed.
> + v2IV = MD5(plaintext[16..511] ||
> + truncated-sector-number ||
> + format-magic)
> +
> + v3IV = MD5(ivseed ||
> + plaintext[16..511] ||
> + truncated-sector-number ||
> + format-magic)
that seems different than what is described here -
http://mail.nl.linux.org/linux-crypto/2006-01/msg00006.html
so is it compatible after all? Or where is format-magic' equivalent
hidden in Jari's description?
> +The format-magic for both modes is fixed at the value 4024
> +encoded as 32-bit little endian.
I am not familiar with this detail and the description does not make it
completely clear, it appears to refer to some magic value of the on disk
representation?
> +Encryption:
> +
> + IV = IVFUNC(optional-ivseed,
> + plaintext[16..511],
> + truncated-sector-number,
> + format-magic)
optional first argument in formalism makes it hard to relate to above decriptions.
So maybe introduce IVFUNC where you describe them above, including ivseed which is
simply unused in one variant.
> + ciphertext[0..511] = CBC-ENCRYPT(key, IV, plaintext[0..511])
I know that key=key_table[sector_number & 63] is mentioned further above but
might be "too far back" for many readers as it is one of the things that are
special about this encryption modes.
Richard
next prev parent reply other threads:[~2010-01-11 21:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-28 18:59 [RFC PATCH] crypto: loop-AES support Max Vozeler
2009-12-28 18:59 ` [PATCH 1/4] dm-crypt: clarify cipher vs. cipher mode Max Vozeler
2009-12-28 19:37 ` Milan Broz
2009-12-29 1:46 ` Max Vozeler
2010-01-04 15:25 ` Max Vozeler
2010-01-11 21:28 ` Richard Zidlicky [this message]
2010-01-13 17:27 ` Max Vozeler
2010-01-17 22:02 ` Richard Zidlicky
2010-01-18 17:08 ` Max Vozeler
2010-01-18 19:51 ` Richard Zidlicky
2009-12-29 9:21 ` Richard Zidlicky
2009-12-29 11:38 ` Milan Broz
2009-12-29 17:37 ` Richard Zidlicky
2009-12-28 18:59 ` [PATCH 2/4] dm-crypt: multi tfm mode Max Vozeler
2009-12-28 18:59 ` [PATCH 3/4] crypto: md5 - Add export support Max Vozeler
2010-01-13 9:52 ` Herbert Xu
2010-01-13 17:37 ` Max Vozeler
2010-01-17 10:55 ` Herbert Xu
2009-12-28 18:59 ` [PATCH 4/4] crypto: lmk2/lmk3 cipher block modes Max Vozeler
2009-12-29 1:18 ` Richard Zidlicky
2009-12-29 1:56 ` Max Vozeler
2010-01-17 11:03 ` Herbert Xu
2010-01-18 16:52 ` Max Vozeler
2010-01-19 8:00 ` Herbert Xu
2010-02-01 10:32 ` Max Vozeler
2010-02-01 10:44 ` Herbert Xu
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=20100111212839.GA29008@linux-m68k.org \
--to=rz@linux-m68k.org \
--cc=agk@redhat.com \
--cc=jariruusu@users.sourceforge.net \
--cc=linux-crypto@nl.linux.org \
--cc=linux-crypto@vger.kernel.org \
--cc=max@hinterhof.net \
--cc=mbroz@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.