Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1059783lqg; Sat, 2 Mar 2024 13:36:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXOJO8UxdoUZ7ZOcqrscQLGyLxxtmYWsNqcOssPJ1EQGy1SQ72RsRjiHI8eNqGoQ6VyDckEfwl3X17Fl7mgKdHxJ1/qEFF+ikYx5FkmCg== X-Google-Smtp-Source: AGHT+IEuHHt8mCwgjhvsRGlc9T5jigpvH4aWhmwd09N3p4eNlBXJD/Y5mtOMknBHYtbI+LfGop5C X-Received: by 2002:a05:6e02:12c8:b0:365:3409:8748 with SMTP id i8-20020a056e0212c800b0036534098748mr7101721ilm.25.1709415378260; Sat, 02 Mar 2024 13:36:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709415378; cv=pass; d=google.com; s=arc-20160816; b=1FwChjfe4ZSmQPr/GsC4JZunvePbTuKiOcqboAfMywERLljkVRXk/3RsLjIlx2u2y8 kQ7RaFWXOMKHahVlvU8GVELAz9EJ7ZlZV6T1WMaLbvCTYemdI27YYgOYmuM5q/HVEeI/ EIAqmroaNJHbxXzLBjxGMM/LEyIIy8cDN2W8Sga6FyYhvi/gbAb+bRJims6gVZlvAJjT 8LB45N9rS+mtD87RYS9MfsFwPvCCTdIlEh5tk4yg8ccUfTdtdnVn08SsL37xyBoVfHJH EJMAys09ULy5AXFT/jp9+6cnTACoOPyOoiCvDojV0KvR2kNideLIaESGiqamv/r5uIl9 cNGg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=Bu1LGFrJm/xp5RSsNrATeg53qcyycal/QVZjYyR+JfM=; fh=gD6+GjWqqOheQ4HVTgt7QFF2Y9E9JvvjOMWSwz5yCHU=; b=KXh3gXz5YdDG7+dYZBBhFEs42d31jgXqGNdnF94z/EoE55krOp/vzC1pDEnaFZ0ZUA weEsE7T8SrtYsSLIRwz29aopmaAU296VpZHEb0lmwbicMS0Z5/G9GgizuFUtdlxfR16W mcOBa1pOngjLmI26SHS/yIndVz9JiuxfDpqyLdI1F92EU9dBGDSWeITEMlONdvvSagxx RDUli2UpGLra615B1Fk28tw98/StQFiO5Kc24A4h/xle+sqjUiVBnMjhpkPJ3dZ0cyPG kJOZmA4xgRcovPXvvE36XigDDRNg6WhyZIavBTRWB7sdKUr3WxqbZa/21qUrxrmY3vws +LRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-crypto+bounces-2467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2467-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h10-20020a63c00a000000b005e430f68ae4si6006065pgg.549.2024.03.02.13.36.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 13:36:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-crypto+bounces-2467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2467-linux.lists.archive=gmail.com@vger.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A7995284423 for ; Sat, 2 Mar 2024 21:36:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 288704122D; Sat, 2 Mar 2024 21:36:14 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [83.223.95.100]) (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 4309D1F16B; Sat, 2 Mar 2024 21:36:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.223.95.100 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709415374; cv=none; b=kO+8k4fgZ/agSDodANBJwumVJdsFFP/AdA1o2qooNY618hnewkwq7IqHNcQKQeia+b6qL2l3uq1ANzSvKhnzkp2Ijt8qlKGNSXl4Qp/OAvxW5DazkJsZzgmqKCiJnQSxzvTiXv7qX7sO6txUx2r8vNRmh/PNxCdSUIZm55d+w5U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709415374; c=relaxed/simple; bh=SOgGtqCOG6kLc+wOCnICsfw03Np5zFBG8Isa7pVYA/M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kPjn4fYHYFn4y2m16/i6XUqmJ7mXomoqpFe1L5IvU0CHApcO5MTlnOd4HN5jCwHdXDgH82gz8hPXogL+CDq9J7BzuiRwYbl1T9AKbvtDgquZXeEivIwYozr5zI6/qyUYcxaERApAUQYVXoK0QfwWVXYm5EkFR7zCo/NgNJm7pPc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de; spf=none smtp.mailfrom=h08.hostsharing.net; arc=none smtp.client-ip=83.223.95.100 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=h08.hostsharing.net Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 1F698300002A1; Sat, 2 Mar 2024 22:36:09 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 157B42E09D; Sat, 2 Mar 2024 22:36:09 +0100 (CET) Date: Sat, 2 Mar 2024 22:36:09 +0100 From: Lukas Wunner To: Stefan Berger Cc: Jarkko Sakkinen , keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au, davem@davemloft.net, linux-kernel@vger.kernel.org, saulo.alessandre@tse.jus.br Subject: Re: [PATCH v3 01/10] crypto: ecdsa - Convert byte arrays with key coordinates to digits Message-ID: <20240302213609.GB30938@wunner.de> References: <20240223204149.4055630-1-stefanb@linux.ibm.com> <20240223204149.4055630-2-stefanb@linux.ibm.com> <20240229091105.GA29363@wunner.de> <20240302140001.GA3095@wunner.de> 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=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) On Sat, Mar 02, 2024 at 04:19:49PM -0500, Stefan Berger wrote: > On 3/2/24 09:00, Lukas Wunner wrote: > > Maybe eliminate the for-loop as well? > > > > unsigned int o = nbytes & 7; > > u64 msd = 0; > > > > if (o != 0) { > > /* if key length is not a multiple of 64 bits (NIST P521) */ > > memcpy((u8 *)&msd + sizeof(msd) - o, in, o); > > out[--ndigits] = be64_to_cpu(msd); > > in += o; > > } > > > > ecc_swap_digits(in, out, ndigits); > > Will take this for v5 with your Suggested-by:, ok? Sure, feel free to, but better test it because I haven't. :-) I'll look through the rest of the series tomorrow. %-) Thanks, Lukas