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 3508AC433F5 for ; Mon, 18 Apr 2022 21:38:19 +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=8GM0eHyOce4TdL9GAVpj7JevRl/9mcqIdQw8BmP6sIg=; b=qHBeRdfrHVQ87A L3nCMHqc1mJIsrZl7dbOkbkeLV1AI+CpXbq8czmCXv4RmKAzPgCoYiRTHGpxuJgMemzPS+4hQQHW8 PoRG4c2gbT6qZbnBOqCm+FLQnou1adzuBq6tsTLG8xt0zDFaTPDeF3FGipsE6iytaWCbJuCxXTssP XtnVDfdrmYPJ9ElT7KWSvMduQ3q6NEM5gH27+UpetXaoDF/zzxtejN9uTxwHjaGj+0lAt94cLvEa7 7beZkBerqMfrY3qJMi5OtlbBN7ZztvGctASNDltZLh6Zh1AN4O9WzTA0/xX65Tm2M+hmR+5NsCxjR cwmvMppu1wcrKpyIaVvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngZ3R-000e1W-P2; Mon, 18 Apr 2022 21:37:05 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngZ3O-000e15-CU for linux-arm-kernel@lists.infradead.org; Mon, 18 Apr 2022 21:37:03 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 434B2CE126C; Mon, 18 Apr 2022 21:37:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49577C385A1; Mon, 18 Apr 2022 21:36:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650317818; bh=0esn0ZH9jB3UkEnwylL/XnIYQGl+ogu9/kfSDs3o3eM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=byYpAVVOjxv+V5btrjCBxU52fJE5kp6fjOhg6cTgLyFuU8k1+Q8EckIdcdEUIX4Kp 6tMevuZ6lyCDJ7teGYTdPquoraepyHDwQg/5ke9qVD1D6wkbKvWeaonG9ngt+DJjCh 7Po370AuSB3zEkfcvSAZLAFWF3wdSWQpySVIe648FjT+lSc9lDqQYlwPESFhHMT+iK cLEVtF4OI7pXAf8YMdge1gL0UvSrT2iPpM53bwekFjh0oPSJ76tW0+K5HLtdKdm0Jk IT0jyuYECLc7GE7CE17rRfTo6W5k8Q4jvPGLcAtFzBwnU1l+wi18rBmnId1LUquCWN 0u0AKlkgR02gw== Date: Mon, 18 Apr 2022 14:36:56 -0700 From: Eric Biggers To: Nathan Huckleberry Cc: linux-crypto@vger.kernel.org, Herbert Xu , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Paul Crowley , Sami Tolvanen , Ard Biesheuvel Subject: Re: [PATCH v4 6/8] crypto: x86/polyval: Add PCLMULQDQ accelerated implementation of POLYVAL Message-ID: References: <20220412172816.917723-1-nhuck@google.com> <20220412172816.917723-7-nhuck@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220412172816.917723-7-nhuck@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220418_143702_646271_92187340 X-CRM114-Status: GOOD ( 15.47 ) 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 A few more comments: On Tue, Apr 12, 2022 at 05:28:14PM +0000, Nathan Huckleberry wrote: > +/* > + * Computes the 256-bit polynomial represented by LO, HI, MI. Stores > + * the result in PL, PH. > + * [PH :: PL] = [HI_1 : HI_0 + MI_1 :: LO_1 + MI_0 : LO_0] > + */ It is unclear what the double colon means. Maybe you meant for it to indicate 128-bit boundaries, as opposed to 64-bit boundaries? It is not used consistently, though. > +/* > + * Computes the 128-bit reduction of PL : PH. Stores the result in dest. This should use the order "PH : PL", to be consistent with the notation elsewhere. > diff --git a/arch/x86/crypto/polyval-clmulni_glue.c b/arch/x86/crypto/polyval-clmulni_glue.c [...] > +struct polyval_ctx { > + /* > + * These powers must be in the order h^8, ..., h^1. > + */ > + u8 key_powers[NUM_PRECOMPUTE_POWERS][POLYVAL_BLOCK_SIZE]; > +}; > + > +struct polyval_desc_ctx { > + u8 buffer[POLYVAL_BLOCK_SIZE]; > + u32 bytes; > +}; As I've mentioned elsewhere, it is confusing to have both ctx and desc_ctx. The former should be called polyval_tfm_ctx, like it is in polyval-generic.c. > +asmlinkage void clmul_polyval_update(const u8 *in, struct polyval_ctx *keys, > + size_t nblocks, u8 *accumulator); The argument order here is a bit weird. It would be more logical to have it be (keys, in, nblocks, accumulator), similar to crypto_shash_digest(). Also, 'keys' should be const. - Eric _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel