Path: csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod From: Eric Biggers Newsgroups: linux.kernel Subject: Re: [PATCH v6 0/2] IV Generation algorithms for dm-crypt Date: Fri, 23 Jun 2017 20:30:02 +0200 Message-ID: References: Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DfyZfS0Q/0KwU0oQ8smEgtEk5LTpdG2cqkstjN58mG4=; b=TCc54AjSwI4ZjIm3hqmSL8xNOmwBdok2xxCLHr6qYtcFdf7rzh0RUcpQoRGm2/a/Q6 XBdglHYF+F9vohgjOx+k8E7Ax9T+d8lYgnP9TWvH/rQywRUTLhvV7g7gxOHpJOxw0QsC Dck5QNhfYJTT2LLthCHcsFA0TCEYGtsKteh7EnelXXKrsqWXpROm0jG2n9O2TKL4NKur /G2gh2cGmkwr3nX05PV2ukuJ/6u1qkc9PEWNrp7bXVap1KlEjdNBSS1/+7ToW9pe4Tcf Dg4zY90HnWiqzDvIinyTBt+eeyEIkI/PBZScraA/eEe+4uVOSzFBpX7vkxT+WY5Gen2E c6iQ== X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=DfyZfS0Q/0KwU0oQ8smEgtEk5LTpdG2cqkstjN58mG4=; b=Fqxq+KU6+Mt0894CRL2IaoWU8XNdGWs29oH7komnb62a70M3gTrhVDY9tNr+vrratm aTDTkJNKZH+9gA9tuexeuHYIfwUK+9KmdpL3jzNUgukygvU/knWGG2Ad8+rD1BrjCYC4 bhOAuBqKe097UIA1HEGqgK7bmK3f60ojH4zhs322diIFDnsA+hs5ymVm3VSyXH7n8fXC 5SxEeHFvwM7PNVt0esI0tABk6Esfn22+vNgjdO7h/VR8TJt3PPDhj28jLXfLKOL8Zz/l M7k6jZXT66S2+7UnREPukw9wLJfPXVnxJjLPNZPLB86vaUMEFQwS5XxlH0pqnJ55cmT3 UXbg== X-Gm-Message-State: AKS2vOygo787qTDa/rwqG4paMdEUb1cqfwQLODUUit0kO3bLS4PTT7Dc k1liaS0yHRMJkg== X-Received: by 10.101.70.193 with SMTP id n1mr9447844pgr.249.1498242119464; Fri, 23 Jun 2017 11:21:59 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 31 Organization: linux.* mail to news gateway X-Original-Cc: Binoy Jayan , broonie@kernel.org, arnd@arndb.de, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, linux-raid@vger.kernel.org, rnayak@codeaurora.org, David Gstir X-Original-Date: Fri, 23 Jun 2017 11:21:56 -0700 X-Original-Message-ID: <20170623182156.GB84943@gmail.com> X-Original-References: <1498106510-19793-1-git-send-email-binoy.jayan@linaro.org> <20170623081341.GA29748@gondor.apana.org.au> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1673759 On Fri, Jun 23, 2017 at 04:13:41PM +0800, Herbert Xu wrote: > Binoy Jayan wrote: > > =============================================================================== > > dm-crypt optimization for larger block sizes > > =============================================================================== > > > > Currently, the iv generation algorithms are implemented in dm-crypt.c. The goal > > is to move these algorithms from the dm layer to the kernel crypto layer by > > implementing them as template ciphers so they can be used in relation with > > algorithms like aes, and with multiple modes like cbc, ecb etc. As part of this > > patchset, the iv-generation code is moved from the dm layer to the crypto layer > > and adapt the dm-layer to send a whole 'bio' (as defined in the block layer) > > at a time. Each bio contains the in memory representation of physically > > contiguous disk blocks. Since the bio itself may not be contiguous in main > > memory, the dm layer sets up a chained scatterlist of these blocks split into > > physically contiguous segments in memory so that DMA can be performed. > > There is currently a patch-set for fscrypt to add essiv support. It > would be interesting to know whether your implementation of essiv > can also be used in that patchset. That would confirm that we're on > the right track. > You can find the fscrypt patch at https://patchwork.kernel.org/patch/9795327/ Note that it's encrypting 4096-byte blocks, not 512-byte. Also, it's using AES-256 for the ESSIV tfm (since it uses a SHA-256 hash) but AES-128 for the "real" encryption. It's possible this is a mistake and it should be AES-128 for both. (If it is, it needs to be fixed before it's released in 4.13.) Eric