Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp441417lqp; Tue, 11 Jun 2024 08:48:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVrhNOMd991XcW8IAlt5E+wGZQSRONU8dl5ncsaz0+erGQ1NvuW1+LDWP3iy8AxQjbhXRSXmenspeocA82JP5aglCydieIc5n4uROURHQ== X-Google-Smtp-Source: AGHT+IHwfo6VbxHvzhhn+nBCAXKbuuKmY0S1Uxxskiv1CJba4rFa15bHE/3yEqfoyn/MWx0UyIwj X-Received: by 2002:a05:6402:1b1b:b0:57c:9cf7:e77f with SMTP id 4fb4d7f45d1cf-57c9cf7e96bmr1146068a12.15.1718120882600; Tue, 11 Jun 2024 08:48:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718120882; cv=pass; d=google.com; s=arc-20160816; b=sd8hamtxPCwWxQO6QYpSN64CaDf745SjmPbQJUsxkDOME68V3GzTngnEQ1CXsOsch7 8qafj1Qv5ofs1JCio8m84Ciec71dCzHDMXdwWAH/AtuMftkH4iho1sF6jtk80xwDXOVx FVxu1QlUBWf+xh/tFctlswpRbxI+6ZXwrqU8kd4gIcyJDnbC1vFol1cr6PWWx9yN3ea8 gRjZ/Zju0bpp91DBc+poLeE5eumNzr6OpbYysk4M2aT3JaalfXVrcJ65Vc9WMgKbY3B7 rh+z11P3UpFMzHDrVE/BOho9HRu0ktaSCsj6f41bx0Qna9d73fBzAkQ5PfyjobnyfygR cgVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=QCrRxmALaWk5YzfM78d87+MhzikoMwNaEth9fBDCzRs=; fh=pIfyicd2bZkgVWG2cbVIQlwNcI2nyONo5F4RKBktgFc=; b=0auAgnPbjWExB25rgCTNUdTzP21LSDh1Uzv2JrM50zzPq93XJTep+C63MvsCnVMDBT M+Ct5rpg+cJtyINlNtxdq6x6apSm2a9g4dFrEt7BVJ5xULp32Jf4mfmQuIqIX5DSXQEG seUdJ5EUpss8QB+Y1o95cqj3pZ9+JSBJIyrrmp87OKLXre2c5YQ/uU/PZq9nvtBUy4vQ BxXkPS7jDi6mPNknENB79XVR8WODFAwvbjdxFqUi5qoe5a7/8iSL+Jg06Q36iLnpQRa5 f/6vu/otVksGnc8dkbeIyRd1MmbaqmJoiP9wAzqMIK0OMFOnuOeu4kkPXiHeAlXgvC3R PgMA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t2mckJAW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae22895fsi5885592a12.366.2024.06.11.08.48.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 08:48:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t2mckJAW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4897-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BBEC71F2598D for ; Tue, 11 Jun 2024 15:40:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2B02381AA; Tue, 11 Jun 2024 15:39:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="t2mckJAW" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61EFB376E9 for ; Tue, 11 Jun 2024 15:39:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718120387; cv=none; b=AGywJKyrPATH0lMoBgm/eUqHmqPuS8bODpuoRayzS73LbM0E5u715lbETeAK5lJdkydMpb3K24Q8hfELJqknix6HNAtwltGEl4XKPnPPe+WbyCh+bAgtyR2US/prm4lQGJTpJ0bIjYLngRH4BM/5Qqe3AmMGZWb/AYTbn65GgHw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718120387; c=relaxed/simple; bh=l0Wz8/b/qUtp1MMRy0nBNac1T85JAy+dV2wUzOiVwmE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=ol2hWGK4QoDg3+Lbv6yS5BeuOdbNugmbLzadMld/6r6qIrJYCglueaBeMl5/GfiuaLcZdcHiONNDB+zXKOwmVxIi0B6RtOg4rcZ55UgSqw4UjPD07s8KFQergqQsbB7fto3pm8Iv7ScFgq2sjcu82yca5asf80RSjROV1VnniOg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t2mckJAW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05C9BC4AF48 for ; Tue, 11 Jun 2024 15:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718120387; bh=l0Wz8/b/qUtp1MMRy0nBNac1T85JAy+dV2wUzOiVwmE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=t2mckJAW+oe1EJP7zUAW4wC/6q5Fvol2jDGiPnlHM86g+Bmevz63HuvAGuvUgTNOO XJLwtZLybIuXwwigMd2WDyLECknlRHJi0YljL69h7tOV44WHr1GPA9bhQH1wZy8TDD 0roD58YLFsI+LKpGXOMGd0aKG4JPNI+MIrPy8Mc/6gUUl/kmumW5IDyU3z7n3/aWtX sEGslOsiG4WRU9y2u3Etyk0VFygoHuE0uNO0qSERXsDgo4Hfhb7IY4lijRcjrL0jy2 AlKAQkL18Mqq9zZlDuzvI0AhI3XS24DwRD7zi+YXNimLuhY0ip0QOPyp7VeYl/GanV Iv5nhcoON8zqw== Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2ebe3bac675so22100761fa.1 for ; Tue, 11 Jun 2024 08:39:46 -0700 (PDT) X-Gm-Message-State: AOJu0Yzj3V8rql5fLH7W0/AT3yn7bdmeEtqVP9mm2u2zKdJll4Yivpmz cW4NVvVn2U/byQdXgcgA408Nn+DXOPVYKyNHikbd41VCOdGTIpePZ4DPXvAp+lPaTFd5oDkkOS1 SzdbCyDqCedTWlGeR4/w1GShoMyQ= X-Received: by 2002:a05:651c:a04:b0:2ea:abac:f97b with SMTP id 38308e7fff4ca-2ebf1039edbmr12147351fa.4.1718120385336; Tue, 11 Jun 2024 08:39:45 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240611034822.36603-1-ebiggers@kernel.org> In-Reply-To: <20240611034822.36603-1-ebiggers@kernel.org> From: Ard Biesheuvel Date: Tue, 11 Jun 2024 17:39:33 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 00/15] Optimize dm-verity and fsverity using multibuffer hashing To: Eric Biggers Cc: linux-crypto@vger.kernel.org, fsverity@lists.linux.dev, dm-devel@lists.linux.dev, x86@kernel.org, linux-arm-kernel@lists.infradead.org, Sami Tolvanen , Bart Van Assche , Herbert Xu Content-Type: text/plain; charset="UTF-8" On Tue, 11 Jun 2024 at 05:49, Eric Biggers wrote: > > On many modern CPUs, it is possible to compute the SHA-256 hash of two > equal-length messages in about the same time as a single message, if all > the instructions are interleaved. This is because each SHA-256 (and > also most other cryptographic hash functions) is inherently serialized > and therefore can't always take advantage of the CPU's full throughput. > > An earlier attempt to support multibuffer hashing in Linux was based > around the ahash API. That approach had some major issues, as does the > alternative ahash-based approach proposed by Herbert (see my response at > https://lore.kernel.org/linux-crypto/20240610164258.GA3269@sol.localdomain/). > This patchset instead takes a much simpler approach of just adding a > synchronous API for hashing equal-length messages. > I share Eric's skepticism that shoehorning this into ahash for theoretical reasons is going to lead anywhere. So I would strongly prefer this approach. We can always revisit this if/when this generic multibuffer ahash materializes. So for this series Acked-by: Ard Biesheuvel