Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1907211ybi; Thu, 20 Jun 2019 06:02:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPpvEMy4ODqBGqgP/vjrEoohDhhLSXGVRLG76o5ghRXLVTvHPLrXkPHxwPSU6QkKs+2nOF X-Received: by 2002:a17:90a:dc86:: with SMTP id j6mr2818348pjv.141.1561035754820; Thu, 20 Jun 2019 06:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561035754; cv=none; d=google.com; s=arc-20160816; b=bo0z6c7VCsX7ldRORKd7PzMbxXBdzNsyUPxI0XuIS6KST1Y2Ihx9OUeStEHB0qbL/V 0VNI8SQESQ1gmIWELKi7xHQMhjTSmHk85OjAKIUQYKEUotb3mKZ+gGOjlz0Vu2t1CTZt uSqJikJURmmH6Z6w34JczaNnaNLJhGIf58iU6DK6svyijieF+9FaZe9dBgqoPdMnsdfO goGv1ouKaS41HhbZoU3J/cy1kHVu7MVbSSrXuuSYk6RBwu2Eq5h4qZVXj8WJIeFFsERa XoVOTEd8uS/8rYVxBeGe3YiHWaoa2PCkaeh8S1c6ipt+jLrvcQSsggMxpzG2nhaEwO/R Z5vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ZG8hEqbKe8+NeO2UU3Wo1+Qx5s8edmihncRtoEu3NsE=; b=nXntf8e2N3zjgWLXJK/VI7HptbS1l3kFdLhdZqNtTm9TC2CAEmnMTpEKHZSt0AZjBV B62fbsjiYm31NyEmYKtIqCGI7ZU1RAAU7E54ovE5Jwh4rxkkVOBgqEOfrjnm29emfMjy yZfXgO3OFQnhZRBcq7NJiB4LfTY+NTOhzpsM0AlrTkq8M1CAK1a6kdlVrBouqxH47Tck l5akIxG6F/67FLLFRNmMYHD/9Ov5dNUh57RPAfyXVT762XazUfyWO44zJ2czA93j3iQc 6v1eWuT6u6+u4Mx6cJ5Evc+fDsqDOxKKywoDSwhXekJvqdRBBYvnReuzPROpgiJI7jsC Lw1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MHTQMQVy; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si4382101pju.64.2019.06.20.06.02.18; Thu, 20 Jun 2019 06:02:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MHTQMQVy; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731724AbfFTNCQ (ORCPT + 99 others); Thu, 20 Jun 2019 09:02:16 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:44251 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726740AbfFTNCQ (ORCPT ); Thu, 20 Jun 2019 09:02:16 -0400 Received: by mail-io1-f65.google.com with SMTP id s7so224888iob.11 for ; Thu, 20 Jun 2019 06:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZG8hEqbKe8+NeO2UU3Wo1+Qx5s8edmihncRtoEu3NsE=; b=MHTQMQVycFJCJ1pv4dvDM7CbdvxB6eMQ5eFLRBVsGLJPwPa9hppCUVqcneOWxT80KF jUe1M05/taAPwL1EJl0AnAGaG0KUbuYUTyWXis/WsdYyGp9eReDMAAK2U/GeHFsA5Rrr 9VeWEtO5w18/7n5diW4KQIqXW1x48GXpihS2l8CkwMHl4QxJ3RwmM0bEPePNnbBTL+BI w2UMRGqFWkrOyc+6jnpUN5gy825JITBUPGdKC75EICXqMjMksL3U6Q/vj4N1U+WFFH1f PcEJxZZcsf5C0ad9umqyZjCFN+XMQN1JiXdijMWXEXkXihw+lfNQi02kqhJCExouBxFH liNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZG8hEqbKe8+NeO2UU3Wo1+Qx5s8edmihncRtoEu3NsE=; b=ghyxCyrdV/e7/xPUhniPxN9KbwkyrRI/YRJTU3Q185KGZmPz4A0MhXH59EWyYjp2pn imdj4Ar9xt5k8Lgy2Iwi37YsGHtTIhQ3Bqv1aJS+UhzWrFOs7bAlLTBqs+Wk1X/eDyCD nGyTmrvPcQqQCBlVSR/f1t40151T4aF/qsPsX9QYqPDYcs1mIrdYHVnvpyCUmmGbTasm ZTImdShA6hFjGbYnpb2/UisLFW9WPS09Bgr2vxJbIgxcKapr42seWonUy12g9vs25s5K /+dnTPHjFMj60W/SOu7EPhZtU2oZMH9zP+BeyvHtEKgiG62LVMxemSK8xU+TldFlErGg Rtdw== X-Gm-Message-State: APjAAAVVO6wK3vU0SdsmE011qP5tczPj+SAg+PGvK+H5YAH4nCBTKxZt bLkwkR5etH3b91/URiCPFFxI6Yppd6nSv8yieAxkUg== X-Received: by 2002:a5d:8794:: with SMTP id f20mr30229023ion.128.1561035735859; Thu, 20 Jun 2019 06:02:15 -0700 (PDT) MIME-Version: 1.0 References: <20190619162921.12509-1-ard.biesheuvel@linaro.org> <20190619162921.12509-2-ard.biesheuvel@linaro.org> <20190620010417.GA722@sol.localdomain> <20190620011325.phmxmeqnv2o3wqtr@gondor.apana.org.au> <20190620125339.gqup5623sw4xrsmi@gondor.apana.org.au> In-Reply-To: <20190620125339.gqup5623sw4xrsmi@gondor.apana.org.au> From: Ard Biesheuvel Date: Thu, 20 Jun 2019 15:02:04 +0200 Message-ID: Subject: Re: [PATCH v3 1/6] crypto: essiv - create wrapper template for ESSIV generation To: Herbert Xu Cc: Eric Biggers , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , device-mapper development , linux-fscrypt@vger.kernel.org, Gilad Ben-Yossef , Milan Broz Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, 20 Jun 2019 at 14:53, Herbert Xu wrote: > > On Thu, Jun 20, 2019 at 09:30:41AM +0200, Ard Biesheuvel wrote: > > > > Is this the right approach? Or are there better ways to convey this > > information when instantiating the template? > > Also, it seems to me that the dm-crypt and fscrypt layers would > > require major surgery in order to take advantage of this. > > Oh and you don't have to make dm-crypt use it from the start. That > is, you can just make things simple by doing it one sector at a > time in the dm-crypt code even though the underlying essiv code > supports multiple sectors. > > Someone who cares about this is sure to come along and fix it later. > It also depend on how realistic it is that we will need to support arbitrary sector sizes in the future. I mean, if we decide today that essiv() uses an implicit sector size of 4k, we can always add essiv64k() later, rather than adding lots of complexity now that we are never going to use. Note that ESSIV is already more or less deprecated, so there is really no point in inventing these weird and wonderful things if we want people to move to XTS and plain IV generation instead.