Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp448155ybi; Wed, 19 Jun 2019 02:14:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqQq59dhVuS/crBWMxlkDAUh1wP1ao6pEs+ZsYCYQ5WlABP1vtcwSmQTkFqC3C+6uWMffR X-Received: by 2002:a62:f20b:: with SMTP id m11mr72533219pfh.125.1560935685194; Wed, 19 Jun 2019 02:14:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560935685; cv=none; d=google.com; s=arc-20160816; b=WjNxgVsLepxraImP3JbR7XIQAgLRk4GGbzfHEp6nHejMGIzC5/yJyKrUhTQVUgi/xQ G0WXew2/ukeVuth0ugBbDPG4aSZGL67PdNURAJDjkUAn1jVCWQoJd2RnC6b2ZzoNGGjR W3YlaW4eaWN6xvWReJQJEkqPCuSIFdPe18oTM53r92VP9+sOZ3YnnVfyulc3sla8RQ8r E/91egunvN04+BthvNqwa/FkITEP7S48YBwYCP/BfsnFVHQ1l6BWChhLbeW2hienPczp x3GVnA1djf7hpzw0OvyAUO8Xbveb0TJXONEySz2OjsaPTiMdqpsepdoXEicvex9ODBFM FSGw== 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=qu2Wc9HSIWJ2oV3uEIa9Pnf61IRfW5CUxnsT2crY2Kg=; b=ttWJaA8hwN4RBKeH4J2uKcPmCcVRRNiuUDH7zcdq8BiwL2GM6OsknWDZETg6cZeH5G u1imZbJLgHCVs1As91sItYcdJdZJaWc+3u9YtXR1Chz6Oy6Fmgg/9svt4ITSTL9yDbwi /BX9Y3qQ/wVjDBWvRrtVeRHzUKy4DAjpB08O35YHg5lQ0HGS7LDqtx6W4F/BY02dt2I9 Mg2bFXy8s9GuNLn/ZhH6L1Rtvf4lKNnvEg8fIKfvWFnkJ17JcWKCCgRk4Tove0BkZnCC M7cA6nGyey6b3jBp2hcTE7w6+LXc3cTTK6eivRsV86rRBn2g/Hrh2batiNZTDfjfZnTU s44Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z1tFpZVK; 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 129si16716994pfe.140.2019.06.19.02.14.24; Wed, 19 Jun 2019 02:14:45 -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=z1tFpZVK; 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 S1731347AbfFSJOT (ORCPT + 99 others); Wed, 19 Jun 2019 05:14:19 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:41248 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726971AbfFSJOT (ORCPT ); Wed, 19 Jun 2019 05:14:19 -0400 Received: by mail-io1-f68.google.com with SMTP id w25so36434623ioc.8 for ; Wed, 19 Jun 2019 02:14:18 -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=qu2Wc9HSIWJ2oV3uEIa9Pnf61IRfW5CUxnsT2crY2Kg=; b=z1tFpZVK/HK0VY5eVY2WNvMLU6ctmJ2nrKm2YDzlh2fQVAcbG9Ua06wIbyg5Sra6Rz IIUhspyguXILIOXCfjypHWkxJWVav8CtN9xD3OAAKJ2AGIRv9Urkb7vqHBcKHKANLrsi REUj6s1MB+naHoxaDD4/5eeah0fLrf/nlCGCqjwry2ck6rSNfmtizUoe0yT0/C23RMuM Ze3XoVCzxsKpFf4xNO9eSlF4P/b4i45AjLo/eA5bERnlvt1voC0FiV3q+gxPD96ct9qk UEWbs2XdqT0OjJd5IY3FOS/6l69+NitTE1kyXcAu3Co5k/UgvPWEs3mp94VrESBRNwlL Gn2Q== 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=qu2Wc9HSIWJ2oV3uEIa9Pnf61IRfW5CUxnsT2crY2Kg=; b=t+Ee8/XkpE07KzbBGsR/DPKSTsY4p5Y7JCMHIKrHmayYZ72UHzD7OSoa7WDTMfMNt0 lJjfpEO6Tdr3ekisMg4fjUww9SYAwBtL42WYcC+YAqzRXhzv+S0X0jB7kh62SVjf5Ndm 8pO0s5RcWGFb1dcywm0vbq/B45JZy8z2BA+bGdCG1lTmT0rW+grKEE13R3S79oO1N3Mj c/n/TO78Nkg2eWE1eah7no/CrzdU7KfT/tbZnT/kfpPMhNEco3f+obSP7+ThwDAaSb9k qRfb+WGGdZ/khpt5utr0x0FqcDuun5186MQGYvXz2i2k0MJHYwucCkbeBFjlA8NK6265 0S9w== X-Gm-Message-State: APjAAAWkysrvmo5RfmcTWDVCXG51zbn8+SE2FqXcXgf4UPhWER+Tfz/8 A8YSv6dGo6sXsSXo+B1qgl05dpkAIpfKOhJv0DRpbQ== X-Received: by 2002:a6b:7312:: with SMTP id e18mr4106503ioh.156.1560935658152; Wed, 19 Jun 2019 02:14:18 -0700 (PDT) MIME-Version: 1.0 References: <20190618212749.8995-1-ard.biesheuvel@linaro.org> <099346ee-af6e-a560-079d-3fb68fb4eeba@gmail.com> In-Reply-To: From: Ard Biesheuvel Date: Wed, 19 Jun 2019 11:14:07 +0200 Message-ID: Subject: Re: [PATCH v2 0/4] crypto: switch to crypto API for ESSIV generation To: Milan Broz Cc: "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Herbert Xu , Eric Biggers , device-mapper development , linux-fscrypt@vger.kernel.org, Gilad Ben-Yossef 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 Wed, 19 Jun 2019 at 09:11, Ard Biesheuvel wrote: > > On Wed, 19 Jun 2019 at 08:56, Milan Broz wrote: > > > > On 18/06/2019 23:27, Ard Biesheuvel wrote: > > > This series creates an ESSIV template that produces a skcipher or AEAD > > > transform based on a tuple of the form ',,' > > > (or ',,' for the AEAD case). It exposes the > > > encapsulated sync or async skcipher/aead by passing through all operations, > > > while using the cipher/shash pair to transform the input IV into an ESSIV > > > output IV. > > > > > > This matches what both users of ESSIV in the kernel do, and so it is proposed > > > as a replacement for those, in patches #2 and #4. > > > > > > This code has been tested using the fscrypt test suggested by Eric > > > (generic/549), as well as the mode-test script suggested by Milan for > > > the dm-crypt case. I also tested the aead case in a virtual machine, > > > but it definitely needs some wider testing from the dm-crypt experts. > > > > Well, I just run "make check" on cyptsetup upstream (32bit VM, Linus' tree > > with this patcheset applied), and get this on the first api test... > > > > Ugh. Thanks for trying. I will have a look today. > > > > Just try > > cryptsetup open --type plain -c aes-cbc-essiv:sha256 /dev/sdd test > > Apologies, this was a rebase error on my part. Could you please apply the hunk below and try again? diff --git a/crypto/essiv.c b/crypto/essiv.c index 029a65afb4d7..5dc2e592077e 100644 --- a/crypto/essiv.c +++ b/crypto/essiv.c @@ -243,6 +243,8 @@ static int essiv_aead_encrypt(struct aead_request *req) static int essiv_skcipher_decrypt(struct skcipher_request *req) { struct essiv_skcipher_request_ctx *rctx = skcipher_request_ctx(req); + + essiv_skcipher_prepare_subreq(req); return crypto_skcipher_decrypt(&rctx->blockcipher_req); }