From: Mandeep Singh Baines <msb@chromium.org>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Mandeep Singh Baines <msb@chromium.org>,
device-mapper development <dm-devel@redhat.com>,
Steffen Klassert <steffen.klassert@secunet.com>,
Will Drewry <wad@chromium.org>,
linux-kernel@vger.kernel.org, Elly Jones <ellyjones@chromium.org>,
Olof Johansson <olofj@chromium.org>,
Andrew Morton <akpm@linux-foundation.org>,
Alasdair G Kergon <agk@redhat.com>, Milan Broz <mbroz@redhat.com>,
taysom@chromium.org
Subject: Re: [dm-devel] [PATCH] dm: remake of the verity target
Date: Thu, 22 Mar 2012 20:15:32 -0700 [thread overview]
Message-ID: <20120323031532.GP27051@google.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1203221739060.11979@file.rdu.redhat.com>
Mikulas Patocka (mpatocka@redhat.com) wrote:
>
>
> On Thu, 22 Mar 2012, Mandeep Singh Baines wrote:
>
> > Mikulas Patocka (mpatocka@redhat.com) wrote:
> > >
> > > This is improved patch that supports both the old format and the new
> > > format. I checked that it is interoperable with with the old Google
> > > userspace tool and with the original Google kernel driver.
> > >
> >
> > Thanks much for doing this:)
> >
> > This looks good but would a prepend/append flag be better?
>
> It does more than changing prepend/append salt. I changed alignment in the
> new format so that it doesn't have to use a multiply instruction.
>
> In the old format, if digest size is not a power of two, all digests are
> placed first and the rest of the block is padded with zeros. In the new
> format, each digest is padded with zeros to a power of two.
>
> For example, when using sha1, the old format padding looks like this:
> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbb
> bbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccdddddddd
> dddddddddddddddddddddddddddddddd00000000000000000000000000000000
> 0000000000000000000000000000000000000000000000000000000000000000
>
> ... and the new format padding looks like this:
> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa000000000000000000000000
> bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb000000000000000000000000
> cccccccccccccccccccccccccccccccccccccccc000000000000000000000000
> dddddddddddddddddddddddddddddddddddddddd000000000000000000000000
>
> The version "0" (first argument in the target line) actually means the old
> style padding and the salt is hashed after the data. The version "1" means
> new style padding and the salt is hashed before the data. If someone comes
> with another format, we can use version "2" for it, etc.
>
+cc taysom
Makes sense.
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Speaking of V2, one idea a colleague of mine (taysom) just had was to
drop the power of 2 alignment. For SHA-1, this shrinks the tree by 37.5 %.
You have to replace the shifts with divides but the reduction in I/O
more than makes up. For the different levels, you could pre-calculate
the divisor.
Regards,
Mandeep
> Mikulas
next prev parent reply other threads:[~2012-03-23 3:15 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-02 0:33 [PATCH] dm: " Mandeep Singh Baines
2012-03-02 16:08 ` Mandeep Singh Baines
2012-03-04 19:18 ` [PATCH] dm: remake of the " Mikulas Patocka
2012-03-04 19:35 ` userspace hashing utility for dm-verity Mikulas Patocka
2012-03-06 21:59 ` [PATCH] dm: remake of the verity target Mandeep Singh Baines
2012-03-08 22:21 ` workqueues and percpu (was: [PATCH] dm: remake of the verity target) Mikulas Patocka
2012-03-08 22:39 ` Andrew Morton
2012-03-08 23:15 ` Tejun Heo
2012-03-08 23:30 ` Andrew Morton
2012-03-09 0:33 ` Tejun Heo
2012-03-09 0:51 ` Tejun Heo
2012-03-09 21:15 ` Mandeep Singh Baines
2012-03-09 21:20 ` Tejun Heo
2012-03-09 22:06 ` Mandeep Singh Baines
2012-08-14 17:54 ` Tejun Heo
2012-03-13 22:20 ` [PATCH] dm: remake of the verity target Mikulas Patocka
2012-03-14 21:13 ` Will Drewry
2012-03-17 1:16 ` Mikulas Patocka
2012-03-17 3:06 ` Will Drewry
2012-03-14 21:43 ` Mandeep Singh Baines
2012-03-20 15:41 ` Mandeep Singh Baines
2012-03-21 0:54 ` Mikulas Patocka
2012-03-21 3:03 ` Mandeep Singh Baines
2012-03-21 3:11 ` [dm-devel] " Mikulas Patocka
2012-03-21 3:30 ` Mandeep Singh Baines
2012-03-21 3:44 ` Mikulas Patocka
2012-03-21 3:49 ` Mandeep Singh Baines
2012-03-21 17:08 ` Mikulas Patocka
2012-03-21 17:09 ` Mikulas Patocka
2012-03-22 17:41 ` Mandeep Singh Baines
2012-03-22 21:52 ` Mikulas Patocka
2012-03-23 3:15 ` Mandeep Singh Baines [this message]
2012-03-24 3:48 ` Mikulas Patocka
2012-03-21 1:10 ` Mikulas Patocka
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=20120323031532.GP27051@google.com \
--to=msb@chromium.org \
--cc=agk@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dm-devel@redhat.com \
--cc=ellyjones@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mbroz@redhat.com \
--cc=mpatocka@redhat.com \
--cc=olofj@chromium.org \
--cc=steffen.klassert@secunet.com \
--cc=taysom@chromium.org \
--cc=wad@chromium.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
Powered by JetHome