Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp226112lqb; Tue, 4 Jun 2024 09:30:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW3VSlcfl3pKJVyHPaGorTXETp5DbS4Smykzzsn6lpflQjtE+7ieZGAqmv7B95+5yuELztgfnngG1joyhAXzWm9d2sN0/S/h8PPuP6QQw== X-Google-Smtp-Source: AGHT+IEYvbKefczoBKe0x5cLEx6yFewdtnIcdDRzJTZjmxJ6kAp3KjzMQ8ZjZ7ukBSL1XNOGkATc X-Received: by 2002:a05:6808:a11:b0:3c9:71d6:511f with SMTP id 5614622812f47-3d1e35c418dmr11908068b6e.50.1717518643937; Tue, 04 Jun 2024 09:30:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717518643; cv=pass; d=google.com; s=arc-20160816; b=yBT4j9HnhxmQ8an7/RwRcxuy4nPerpyl18JCNk4Q8uYeZqk6OOkT2YFj7VGHeWWlKa nJswwNWQki0MBHuq7T8xCFYqnTozXSyg28Lr1JgyP7fKZL41AcOeCJPBN5fbB+e+5Dfk VqoxL2hxFMMUm6zLaErLt69g1hpvmcxg+lYiffts94Y/W5xvwwYpiNWLsymtGVt1zIF7 H18A4GWZehpDKkNfTgDx6Fvs/ZWoWt/XXQ1erS4zIb4N2G8cBtq1hC4FXZb2tyJL2yZ8 +297jUpK3uiAipLzMPP5gAf/VSABxIMBOrrM9G0FXyksP8mIm1p6YYqeYvsjTYOX+i1U dAvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=5Sv3SUjist+DLYePEumMt1tbhhFykDLSYaPGA4bWwxE=; fh=cRF+JaemhuY90vL1oN5RBbHdbq+ZBgUjheeVhGyPxnY=; b=LqwqgF0VJVf2A2Yj53lX63HpzafFJEOQNC0IRxIG0gRW6SdFuSjYnnsDj3ZO2vTj3V Kt5whA+B/PjtZqpCbwjZounrjY6yvsKghEJbrl/77FlWz6+TrDab49xlVHZkkgrMxACP iQK9eLWFN3WhnebudLnrjzo49e1GckUGXMZnKugdP1Jew1mVimARubo+p/SgJDCc7VT3 6DoNL/v5dHWkjagRtT2lfZTLvv39A2RkkJL8KmP4F1JX1s+m6RGhIkikNK4iyMg4b9Cu Y8mmz4nQym4hlPOrR8tdMIbjvcLAlmfXrABHDNtibe6+VgI2ilZkMYdILb+ZvoidXU// VyIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qfKXckxj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b4150f7si115490456d6.360.2024.06.04.09.30.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 09:30:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qfKXckxj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4689-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8E8511C22059 for ; Tue, 4 Jun 2024 16:30:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60F621487CC; Tue, 4 Jun 2024 16:30:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qfKXckxj" 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 0F624135A51; Tue, 4 Jun 2024 16:30: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=1717518633; cv=none; b=OeCSkQBZMpiVagHX2ayFuw5qmglo87Ttjlk7gnyMIGVZqFtcvJgIXIwQvYa1/AZMPTklUkXImrpyCHzwJMIWOruGkL4O7oXYyxq1GAWvOei9aQjvnpg04bLqiFiozt0ho0MEsdTOEIi1gNBMcxzHKeNsMmVnIhIp36l8vuVFs8k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717518633; c=relaxed/simple; bh=VYfxBurXHxczP7ZhLOxXOA47hVbiObZ0mU1zWkMrQyQ=; h=Mime-Version:Content-Type:Date:Message-Id:To:Cc:Subject:From: References:In-Reply-To; b=f6Q9tf+mhxe3nmk+yNftRDL8Vur40Blt9YyH6XueWLPIrAr+nrQByMC0YVEYaN8MngyCMWP4N1Kx/KvcaMYe/7J4dmwPfNlXbs6a+zDpP01W4hYYmYIRgg/zhoqv1S91gFf9m3HpbgEqwN1mfmb4SLQU0XFUVOqqDb/W36UatbA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qfKXckxj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 126E3C2BBFC; Tue, 4 Jun 2024 16:30:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717518632; bh=VYfxBurXHxczP7ZhLOxXOA47hVbiObZ0mU1zWkMrQyQ=; h=Date:To:Cc:Subject:From:References:In-Reply-To:From; b=qfKXckxjQLUqiYOxFkKaC03gn8b9ipaeDRcL6JGuedSSW5cOK1snl8pAGCLTwfltl kWfLOK2/E3ee29537Gn3hX2MWiKlzSR/gWOy3/zgQjDlMyukkrDuZFqcLznwbpRrrE Stz/BhKKTY/1Ns2bH8Wh+5vzeXu3XhiT0rUgFbUS8og3IWNcxvbvadyQgwq2ir0OgY fACud7eB8Hn1NyVv4R7OvtiAvM6oOIAaYFORPwk5w7F6G6S6hT4hZ3fybbbU5J8yqW epTmfBNGwLBZcDzcBX9Ka5kgIX8NcT+qp8BxyDhnq/zHi2J/+hdGQl/HdaB9ADblWQ D8BE5g+I2TftQ== 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: Tue, 04 Jun 2024 19:30:29 +0300 Message-Id: To: "Stefan Berger" , , , , Cc: , Subject: Re: [PATCH 0/2] ecdsa: Use ecc_digits_from_bytes to simplify code From: "Jarkko Sakkinen" X-Mailer: aerc 0.17.0 References: <20240529230827.379111-1-stefanb@linux.ibm.com> <435d756d-2404-4f66-9ce3-363813997629@linux.ibm.com> In-Reply-To: <435d756d-2404-4f66-9ce3-363813997629@linux.ibm.com> On Thu May 30, 2024 at 3:16 PM EEST, Stefan Berger wrote: > > > On 5/30/24 01:08, Jarkko Sakkinen wrote: > > On Thu May 30, 2024 at 2:08 AM EEST, Stefan Berger wrote: > >> Simplify two functions that were using temporary byte arrays for > >> converting too-short input byte arrays to digits. Use ecc_digits_from_= bytes > >> since this function can now handle an input byte array that provides > >> less bytes than what a coordinate of a curve requires - the function > >> provides zeros for the missing (leading) bytes. > >> > >> See: c6ab5c915da4 ("crypto: ecc - Prevent ecc_digits_from_bytes from r= eading too many bytes") > >> > >> Regards, > >> Stefan > >> > >> Stefan Berger (2): > >> crypto: ecdsa - Use ecc_digits_from_bytes to create hash digits arr= ay > >> crypto: ecdsa - Use ecc_digits_from_bytes to convert signature > >> > >> crypto/ecdsa.c | 29 ++++++----------------------- > >> 1 file changed, 6 insertions(+), 23 deletions(-) > >=20 > > BTW, would it make sense split ecdsa signature encoding to its own patc= h > > in my next patch set version and name it ecdsa_* style and put it to > > ecdsa.c? > > I would only put it into ecdsa.c if functions inside this file (can)=20 > make use of it, otherwise leave it in your file. Yep, that specific part has no binding per se to anything related to TPM2. It is also dead easy to detach. Here I would suggest to take a similar angle as with CRYPTO_LIB_AES so that it is easily and directly callable from either side with no fuss. I'll mangle it that way at least for the next version and we can see then how it looks like. BR, Jarkko