Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5137854ybh; Wed, 7 Aug 2019 01:09:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2Gs0zxt+YE+VAZ4UyIreZOsE4BNYzMWVBWgHkayZ5wtJaEMQ7kX054q3OJqi0C+DIej80 X-Received: by 2002:a17:902:bb81:: with SMTP id m1mr7118702pls.125.1565165386994; Wed, 07 Aug 2019 01:09:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565165386; cv=none; d=google.com; s=arc-20160816; b=zkFe9nMnWQkv5OOye17yABlIpUY6R2z4+Ck987CT6tpzjbELQFzr22pD8j//NI8ZTs B7L9kyu5NlIjUi2ImHxZ2i6TQ/9J/yvxbXEFhGERlT49qO3n4s9ljH2UKr+DgaB7YkE7 JJrYJZgOJK6fAyVzqln8vF58UW9DCip3YzaBW/phkaLnsEaEySIOrG/kksjB/vlZwDdC o5ngzx9n45+iy0IvO7GgeXVHm5b5NJ7QTkPE4ZklVl4XvHd0QrKTD/2ZJ7nCk8uMbDha CNcxg1Ki+Okmq/f4jinwCMZw5QcjPo0FJr4aeZ6n4f9BRzNpp3acszWfIZmlKG4+akjL BuRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject:dkim-signature; bh=fG52fuDXQj1Bi6oU2rMeiQi7jmehOcFj549DOFtvvcA=; b=xsjtwJbXIaER1EbUw3GK1WxMlvolD8jdaTVKe9QCnIuh/dLRDB/d4xCSGvZJIvHwnt WRzeadNVoFhxYRpb68gv5EQmwod+ddGDId2wkILhNzUp16OcO0VkYnvvV+pPgIW26ojj CX7dEXWzireG+6s8Vcjz2rqQaKxIzWrPMuo/esuhLlr6kh218gBA8PVO7GLU9qsVPdCH OjOWNLB5mSCXqj3NmBHFS9rE4X2Z0DvKkLhg0f4UDmx1VFIuzH0Bs/3HNFUZxdw4v8va KOXmjuMbqgOVQkMYwGKNfFwHOl5g7Ljkk766oiI9WCM4jjGZnOxFNcNdxGmO8Qb3SL79 Xo+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uI8uJ3cF; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb11si48401025plb.100.2019.08.07.01.09.26; Wed, 07 Aug 2019 01:09:46 -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=@gmail.com header.s=20161025 header.b=uI8uJ3cF; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727842AbfHGIJC (ORCPT + 99 others); Wed, 7 Aug 2019 04:09:02 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:36670 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727413AbfHGIJC (ORCPT ); Wed, 7 Aug 2019 04:09:02 -0400 Received: by mail-wr1-f66.google.com with SMTP id n4so90455767wrs.3 for ; Wed, 07 Aug 2019 01:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=fG52fuDXQj1Bi6oU2rMeiQi7jmehOcFj549DOFtvvcA=; b=uI8uJ3cFRakpHP5sOZnNR63nmlglCor5vipRBkY7I91V9JYMXWdFCSiqKJZN822YzV HdwCpwKs2ez0RnrUhW1O8vkLAUNP6pe96NO4eLD9sREE948FdN4D8RFOfvrtuG6b8OC+ 9ykQ6vXX01glmYwZm2ifOuHNMP/sQr1Z3K8THBIjImDXr8fNlJ7QblsCR9vhVTbEHnAi 2ydW9h/OW+vQYmICUvDy2ZIAhFOP0qxOx2XJ0qPc2c6P/bLEuog3IGw+pnkqPVkQ78GA /jqoE8FSJBbJD4Z09bC0gX6ZT4Tz7HozI0JnpLsLZT7nc2c8w1VghLA4zdj4bEBIUKpu VUNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fG52fuDXQj1Bi6oU2rMeiQi7jmehOcFj549DOFtvvcA=; b=bM0eJ3AkMqPPqEEi83LTvwDTUcwU7WAgjP8paDKrE6ammojLm9WZS0+ZhiNdtBwwDl jDYjojVY1L1uUjAW/xkkancYcEq08FOMPTypfyjRcCb5CEesfD4ACyhUz6htmELTE3lr 3RsUwvS3yzF+y1JkNPOG5R/5vPfFJDJfDgB3yIuvZuj7vbY7clyYu9AMnUi2V/ezZjXc tULR4RWjLjyA54JeUbnh4iUhJTbasUJAJoKET+L0aQb7h91GB+f4+Pqse3JyGdx/wmZn C3IGqvy9xGWqFmgEd0HPDgbBCOCawyiBCVOqqIsdxVFhg+/Y+z7L4RLXGRdY4kq1uyS0 JExQ== X-Gm-Message-State: APjAAAWngNuLlKulytnTNl4PFWsDOU+cuFTQYLDFM9Chw3L4Ue7u135H oEzfHkZFZ3/lUPczo8UdFWQ= X-Received: by 2002:adf:ef49:: with SMTP id c9mr9492849wrp.188.1565165340088; Wed, 07 Aug 2019 01:09:00 -0700 (PDT) Received: from [10.43.17.10] (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id z6sm2377162wmz.46.2019.08.07.01.08.59 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 07 Aug 2019 01:08:59 -0700 (PDT) Subject: Re: [RFC PATCH v2] md/dm-crypt - reuse eboiv skcipher for IV generation To: Ard Biesheuvel , linux-crypto@vger.kernel.org Cc: herbert@gondor.apana.org.au, ebiggers@kernel.org, agk@redhat.com, snitzer@redhat.com, dm-devel@redhat.com References: <20190807055022.15551-1-ard.biesheuvel@linaro.org> From: Milan Broz Openpgp: preference=signencrypt Message-ID: Date: Wed, 7 Aug 2019 10:08:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190807055022.15551-1-ard.biesheuvel@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 07/08/2019 07:50, Ard Biesheuvel wrote: > Instead of instantiating a separate cipher to perform the encryption > needed to produce the IV, reuse the skcipher used for the block data > and invoke it one additional time for each block to encrypt a zero > vector and use the output as the IV. > > For CBC mode, this is equivalent to using the bare block cipher, but > without the risk of ending up with a non-time invariant implementation > of AES when the skcipher itself is time variant (e.g., arm64 without > Crypto Extensions has a NEON based time invariant implementation of > cbc(aes) but no time invariant implementation of the core cipher other > than aes-ti, which is not enabled by default) > > This approach is a compromise between dm-crypt API flexibility and > reducing dependence on parts of the crypto API that should not usually > be exposed to other subsystems, such as the bare cipher API. > > Signed-off-by: Ard Biesheuvel Yes, this is a good idea, I'll test it. Thanks! Milan