From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEE12C27C52 for ; Tue, 4 Jun 2024 19:25:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Cmpm6dxtN7W9nXvtvDMnaV29jWamt7lJkVPCphAReMA=; b=PyNwQNXoCKeGPp Ya9md1bOMYgfJu7TWFQdDPFgXuuN1Dk+GOpnYkfJXPet8ThY+1+iptKPMEa3/JUmF2PZS4P93vBib kr399bBJw5W5YJE9Xk7U+GwpgWVidGcY6/49aS6bsFdG8mW84g9FblNzj9lDnLNrvmcRmJdneyKom 59oQZel5Q406HasHrmNNk/GMelcm3O7e7K9Xr4EVWDzTxgTgS7JE9Ku/p8s4TGjqGlGqR3i4mAFDs QcOR5pWtLImPd0etL1wdZboxjBzwPtd76oN6wQLSXRCz4+0EIOyB8z7+EbKzEuHC6PAwomI/qLaHd ibK84RSSogMnZxur8sRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEZn2-00000003aO9-3wrr; Tue, 04 Jun 2024 19:25:48 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEZmz-00000003aNU-2l3X for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2024 19:25:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C58116142C; Tue, 4 Jun 2024 19:25:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36641C2BBFC; Tue, 4 Jun 2024 19:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717529144; bh=CfdX3QgpBeGkiViJGYp7o44OH979z8N7+Zs7t2WW+f4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=A4f+pTcO0TotuaZzcRhFq6IxIsRM4Qm8d2eF2w0RCHVEGfvBUyiY26sLeUEe2H+yZ gt+rOwUYrpWu7NmOPqtcgwQjhrRVFuM+pmeaMmkqPFln5SwJ5z/HtlucTFd/eiwTWk VPaDNYps3o6VgZXIrGE8d4/XgTxJnCm5q/AzQgP7D+LjJScqnfEdjk+cv2s+MNDLgk rA0n2GJkJeX6VJ9e1wBFVE5tF7LFKDdfyBMgYTZov8WakYIeJuoQ2h1fwXSPV0jlAC 041k0uANAgAnRtlSfIENmxulVOMGM7ee+vei2prIem8AOmci/IVlsIqa+Bo2EKGS6M iVExfLAsdSi1Q== Date: Tue, 4 Jun 2024 12:25:42 -0700 From: Eric Biggers To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, fsverity@lists.linux.dev, dm-devel@lists.linux.dev, Herbert Xu , x86@kernel.org, linux-arm-kernel@lists.infradead.org, Sami Tolvanen , Bart Van Assche Subject: Re: [PATCH v4 1/8] crypto: shash - add support for finup_mb Message-ID: <20240604192542.GD1566@sol.localdomain> References: <20240603183731.108986-1-ebiggers@kernel.org> <20240603183731.108986-2-ebiggers@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_122545_854859_49084A57 X-CRM114-Status: GOOD ( 16.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jun 04, 2024 at 08:55:48PM +0200, Ard Biesheuvel wrote: > > > > This patch takes a new approach of just adding an API > > crypto_shash_finup_mb() that synchronously computes the hash of multiple > > equal-length messages, starting from a common state that represents the > > (possibly empty) common prefix shared by the messages. > > > > This is an independent optimization, right? This could be useful even > more sequential hashing, and is not a fundamental aspect of parallel > hashing? If you're referring to the part about using a common starting state, that's not an independent optimization. Only multibuffer hashing processes multiple messages in one call and therefore has an opportunity to share a starting shash_desc for finup. This isn't just an optimization but it also makes the multibuffer hashing API and its implementation much simpler. With single-buffer there has to be one shash_desc per message as usual. If you're asking if crypto_shash_finup_mb() can be used even without multibuffer hashing support, the answer is yes. This patchset makes crypto_shash_finup_mb() fall back to crypto_shash_finup() as needed, and this is used by fsverity and dm-verity to have one code path that uses crypto_shash_finup_mb() instead of separate code paths that use crypto_shash_finup_mb() and crypto_shash_finup(). This just makes things a bit simpler and isn't an optimization; note that the fallback has to copy the shash_desc for each message beyond the first. - Eric _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel