Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4915163rdh; Wed, 29 Nov 2023 14:44:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IEs8r2U2ZunmLXswF1YdK/kNooln+xZT7RX65dP9mNxKS/Us76QfePPI18n4vcMJDdcgJTS X-Received: by 2002:a17:90b:4c05:b0:285:25b3:4d5d with SMTP id na5-20020a17090b4c0500b0028525b34d5dmr18122879pjb.8.1701297879990; Wed, 29 Nov 2023 14:44:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701297879; cv=none; d=google.com; s=arc-20160816; b=UjsvVAdHmlXeyowzWddppks0t7TnkBCZfgAvdnUBrTPA5kODOqgILYpPkbtaTy4kbz nC3b/usS/T3+vEFgAVCkRheYMhBFRP5wJkA1apLBXo9VB4PddQSI49nii5G0Mn0WMY5H +lpUMixAuZWOL0WMH/fvoV0i8TGuJPJUaRhPpzzDwwm/oHCdhRKqAHAIg5aspiHyMS2+ mCcR86OgW+qihQoKxwwm8TONKP3Z/J1coLfu2rV+l3PoAszONyBWzSBSFGgY1jQvLbO6 XTVBnkMM5KAiMQ+be825QuNrnbQ/bjBZKBVVGJm9X0m1WIzD0kPl5ReTkbPiHo2EYDru 94jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DYZCM2dodRTK3VoQvRZqPER27DQFBdL+rx++p7LCts8=; fh=OpAsbrbMdqgZgOYABLZx3JHmbk7yjEgWI8a2j/ohICU=; b=Uph+9jfkXgmwuzJwSBBmrp4JuLLXVsKsrnI+yj1WrJxU8cv4MV8yxlsSEl/BlmIR5x CT2hCllydAFSn0ihzTVKhDa5lat06//OxsbEX9ou40XaITiD0gwXhYh8NfAsTFSFWIbZ gHXfaS9sl07C9Q41YyF3xzH3e+o6lbmHDJxyGFs0T7st2MeW1gL/kSTQHpp0XrbEos3u fj4u/p0045cYqynAJCeH/U8ZVxd1ibdo1B/V5kgYm6G82XyHkWpV15+DEQCOX7uRXJcm Hnz62/zo3w76NqoRMBWFQ2SDuXXAd3/rgoKIId9use/v//WblriFSWPlvgXkh/wItmpO omDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="DxldB/MK"; spf=pass (google.com: domain of linux-crypto+bounces-393-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-393-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t20-20020a17090aba9400b00285a3fa637csi2167585pjr.3.2023.11.29.14.44.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 14:44:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-393-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="DxldB/MK"; spf=pass (google.com: domain of linux-crypto+bounces-393-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-393-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7A0C2B20F5D for ; Wed, 29 Nov 2023 22:44:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC00147A44 for ; Wed, 29 Nov 2023 22:44:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DxldB/MK" 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 50D5B5EE7D for ; Wed, 29 Nov 2023 20:46:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98329C433C8; Wed, 29 Nov 2023 20:46:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701290817; bh=K758Cy/Gxmng67owvd7DkjuhwZTMbLkHdEXabzygaD4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DxldB/MKnA9eORjw03tyyQSQ3n35GLy/4GhHKDFP0qU3MLGAKAhBt9R/Yr+Qv8ixa 67aaH2F8/230fZUL6az5uYGuZO2alnXRP/fmh/jiYGeQ0iPSehu2eBclcU/NG1lEAB 7zZIpqdZMEOYrQf3mKflRyZokoiJEZibmQFzgeNy1UnyMH1n9ruZMvmZRthkIim9dt /gRzGSKBDLYyCR0T/q7AW8IZXsKUgG9YZdTOMmlMsNvCw4EXxzkLnZoqiFCRVp+OEs RZCIaQEzVo3BoLjcFzXCiXSepgFZ2RsvfQxvKJjU0ASs9/oaRiDLrc7muCmU9Yl3U7 //h9w2O7fjw6w== Date: Wed, 29 Nov 2023 12:46:55 -0800 From: Eric Biggers To: Christophe Leroy Cc: "linux-crypto@vger.kernel.org" Subject: Re: [PATCH 09/30] crypto: talitos - remove unnecessary alignmask for ahashes Message-ID: <20231129204655.GC1174@sol.localdomain> References: <20231022081100.123613-1-ebiggers@kernel.org> <20231022081100.123613-10-ebiggers@kernel.org> <1a63d090-02b0-49b0-8c6e-50d71010b0a4@csgroup.eu> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1a63d090-02b0-49b0-8c6e-50d71010b0a4@csgroup.eu> On Wed, Nov 29, 2023 at 03:00:48PM +0000, Christophe Leroy wrote: > > > Le 22/10/2023 ? 10:10, Eric Biggers a ?crit?: > > From: Eric Biggers > > > > The crypto API's support for alignmasks for ahash algorithms is nearly > > useless, as its only effect is to cause the API to align the key and > > result buffers. The drivers that happen to be specifying an alignmask > > for ahash rarely actually need it. When they do, it's easily fixable, > > especially considering that these buffers cannot be used for DMA. > > > > In preparation for removing alignmask support from ahash, this patch > > makes the talitos driver no longer use it. This driver didn't actually > > rely on it; it only writes to the result buffer in > > common_nonsnoop_hash_unmap(), simply using memcpy(). And this driver's > > "ahash_setkey()" function does not assume any alignment for the key > > buffer. > > I can't really see the link between your explanation and commit > c9cca7034b34 ("crypto: talitos - Align SEC1 accesses to 32 bits > boundaries."). > > Was that commit wrong ? > > Christophe Commit c9cca7034b34 ("crypto: talitos - Align SEC1 accesses to 32 bits boundaries.") added an alignmask to all algorithm types: skcipher, aead, and ahash. The commit did not explain why it was needed for each algorithm type, and its true necessity may have varied by algorithm type. In the case of ahashes, the alignmask may have been needed originally, but commit 7a6eda5b8d9d ("crypto: talitos - fix hash result for VMAP_STACK") made it unnecessary. - Eric