Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp656134lqp; Thu, 21 Mar 2024 11:24:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUSCttYFtx8Y/zUBRLzTS0WTOnNxd67iE9LcjC5Mx5nZ2Xz5vVu12ZKu+ymKmHDtuONMpaNug7nJWqgQBYqWvg+e5DLQRjNELYE1bmFew== X-Google-Smtp-Source: AGHT+IF9ZTf9H9N7YfL/eiAbyD0dBGZX/d5VODVk07lHZpFlZIl2B9HtK5HTw7dTjhq8rZzcPtVg X-Received: by 2002:a05:6a20:8f18:b0:1a3:6ee8:b84c with SMTP id b24-20020a056a208f1800b001a36ee8b84cmr417373pzk.13.1711045480453; Thu, 21 Mar 2024 11:24:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711045480; cv=pass; d=google.com; s=arc-20160816; b=xsvciSonRkphfEeBjl7kfqOb6R/IZZ1wowAWBdoNG6eWFsdWuaFwr8x0MpoOIRKQZD iC0SE+wFp7B/YraJpe8OzFCGpCi8IXWZC7m8dDk9wbiKsmfqxDaWTSv6wutWD+0fIwT5 x3oVU0axR0Cj4egYzN9skFdeX4u45SdOIZ1208kxxJIU6DrYwfftf+G0bPaGOKoy9pwv IiqPRnWiN0gMiyU2OiVEprONUmohtKCG3304hYAnAHCcJ5TMWeStDmEW7I/JeFjKoJ9J 74ZgCqPQ9tajB0LYyh649CXxLzH3e6US1pQ4y1tUhppwC0vnRXZwR+X4NF4Xma4hsiv6 OVjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=fzcMF91olthWHqKZibok41Ueyrz0nudIObLoZ3pcAoc=; fh=nR2nS9yvo8rBLcqBTWdVdTZMSYf1MQu9UGN1RA8/poQ=; b=q42ol6thiiS9uI5QPFlu4+ccbsXrG5m8r70nsqIr9z7omYeCgCWCswqiDNtsa3Sh14 qFuYQq+F0gU3TlpVJi4APgMoWwlQP/2Hj/kdNxn0/DD/oafcTNS+SulX4blWqSJJc6aL Kl9PO8G0CbvIC6kkxDfnzpGMwT2trpkeWwExj53IKn0tT9FKcn9Sl4PgrpM9C7O1GQGq oaPfs5kxv4vGuBM4r9sQw4m+obxvOzCXR62JCvoiDSwIszIoLiz1I49yTZiXKpU8FZMO ns3DBI0cWlwddXrALVCDngbCxUUcHavAteQKzXHX6YDIfviG+BcupA50AjAMxDr1a8sZ 1Dyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l0EQyOKG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-2817-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2817-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 y8-20020a056a001c8800b006e63f027285si252688pfw.19.2024.03.21.11.24.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 11:24:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2817-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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=l0EQyOKG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-2817-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2817-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 00BC2282C88 for ; Thu, 21 Mar 2024 18:24:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6A9F133408; Thu, 21 Mar 2024 18:24:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="l0EQyOKG" 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 9D66379C3; Thu, 21 Mar 2024 18:24:32 +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=1711045473; cv=none; b=XXhyxR25tQ6TV6/E73Vr2FLQa9nfzt1kFomoKLXLWRlVLSg5iZ2gG0gW52enFO3Kg/i3+MBHz8x9E+pdv3iqPnGqBmd+j/sIMapfZWD8m7C9+SlDQwzU4KkQ9Jmdax3jc1FpN0PnPl+8JKjJ49ApqpMR1IHlQYgL1w43tTFtIks= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711045473; c=relaxed/simple; bh=6XDm0H7ukgWK62f8uLvS2K0zAt4z5bHjRTxNVSBu7FU=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=giDvePGzZcjP7GJUHhYmxnLi25gryZotNusl4ynlbi1AdIDweeTldlUxhbFa7UZOckdT/Rqc0yBhtzr/iNq+GjvcKWhJTQ685GrcQPcU/D3kVhH4b7te8UNX2ZcXyqizOZHETDvH8qw/EDF3QOwFqE0TEOUFEVWrAEX57TByBy8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l0EQyOKG; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E949C433F1; Thu, 21 Mar 2024 18:24:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711045472; bh=6XDm0H7ukgWK62f8uLvS2K0zAt4z5bHjRTxNVSBu7FU=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=l0EQyOKGlSqTAnbBIdyevJIWPpZnrVnPa3Y0y3Z5RlyshAt52oVRZPMfLjqK+PcfD 7sHFf4AyhqH+80XW6vhex7Zav9GuzAIaD1aPG7NGNNobWOx7BpZl+OtMmVFXL4kk4l YZOM0VbcOrraIPYwN+JfmfS4w8bnuyAB7UnEcJzvDpzEiJVUKk+T9XywBSogUjxgUl +VSCZC+YLqL/rkaF2rhhnNkIUGbmC3nqkcI8zkDRmuadYe52u33ZXLsgCxHI7dSxwl mCtqtWCvm4rCktdJ97xjRo0qTvTNUdPqF2YHsBTiHeYvw0rs4o8pIIuvK1DMej6x2a Z8RbdXpTWjRnA== Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 21 Mar 2024 20:24:28 +0200 Message-Id: Cc: , , , Subject: Re: [PATCH v7 05/13] crypto: ecc - Add nbits field to ecc_curve structure From: "Jarkko Sakkinen" To: "Stefan Berger" , , , , X-Mailer: aerc 0.17.0 References: <20240320114725.1644921-1-stefanb@linux.ibm.com> <20240320114725.1644921-6-stefanb@linux.ibm.com> <58166047-b339-4234-832b-a1aad6bf49de@linux.ibm.com> In-Reply-To: <58166047-b339-4234-832b-a1aad6bf49de@linux.ibm.com> On Thu Mar 21, 2024 at 7:42 PM EET, Stefan Berger wrote: > > > On 3/21/24 13:17, Jarkko Sakkinen wrote: > > On Wed Mar 20, 2024 at 1:47 PM EET, Stefan Berger wrote: > >> Add the number of bits a curve has to the ecc_curve definition to be a= ble > >> to derive the number of bytes a curve requires for its coordinates fro= m it. > >> It also allows one to identify a curve by its particular size. Set the > >> number of bits on all curve definitions. > >> > >> Signed-off-by: Stefan Berger > >> Tested-by: Lukas Wunner > >> --- > > >> .y =3D tc512b_g_y, > >> diff --git a/include/crypto/ecc_curve.h b/include/crypto/ecc_curve.h > >> index 70964781eb68..63d5754e7614 100644 > >> --- a/include/crypto/ecc_curve.h > >> +++ b/include/crypto/ecc_curve.h > >> @@ -23,6 +23,7 @@ struct ecc_point { > >> * struct ecc_curve - definition of elliptic curve > >> * > >> * @name: Short name of the curve. > >> + * @nbits: The number of bits of a curve. > >> * @g: Generator point of the curve. > >> * @p: Prime number, if Barrett's reduction is used for this curve > >> * pre-calculated value 'mu' is appended to the @p after ndigits. > >> @@ -34,6 +35,7 @@ struct ecc_point { > >> */ > >> struct ecc_curve { > >> char *name; > >> + unsigned int nbits; > >=20 > > Nit: > >=20 > > Hmm not strongly opionated here but wouldn't it be more consistent to > > use u32 here as the types below are also exact bitsize types? > > I will change this for v8. I will probably delay v8 until this patch=20 > here has been queued for upstreaming because 11/13 will need a similar=20 > module alias. > > https://lore.kernel.org/linux-crypto/20240321144433.1671394-1-stefanb@lin= ux.ibm.com/T/#u Right for this: Reviewed-by: Jarkko Sakkinen ... given that I don't have strong opinion on the choice :-) BR, Jarkko