Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1454352lqg; Sun, 3 Mar 2024 10:47:58 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXJ7rSl06nLj0YapsXm5iUOwY8VkVk1pk3mrIR9kZEw92iZgFIDPsrc/POK+zFlrmVBPJaApvJ7XZGVdr5K58fr5avUPJvcSbZYTHjJRg== X-Google-Smtp-Source: AGHT+IGFVrIro/gXVNC+81Q1IyZnZmYmjKbzyaYiNEtm7MtKELZnZDK1+jD+b2WCcXuKQ2C+70E3 X-Received: by 2002:a19:ee04:0:b0:513:2027:27db with SMTP id g4-20020a19ee04000000b00513202727dbmr4568517lfb.17.1709491677903; Sun, 03 Mar 2024 10:47:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709491677; cv=pass; d=google.com; s=arc-20160816; b=ncm0urfqX7vaYANnbbUxxbRv8j7ZNUbJu2ax6vE1JNrX3MRbd4HCVAfSkxltv8B8u4 O8c7jKw3bYzoTN6T/IvBlTsh4kwL4gx6tS6utIXGFWxQ8CB1F8TVjYVefios8ksn4q8z mXQAuMk0ie7yIP1uYeKPcpbnMpS+LarqBxVBS7/EwC3xM9Rf0UT7ikq8bbPrwuibFgzD m1v9JZehJE4S1ftp6leyXQIRPcbFAGG/2oK7Zi3uXmwZjrLujlUQ78aUwJxfKPqIIdlb rVHm0M6761PUqLPw3TwP28pZQOP28rfrZ6ojHpSBn++HersIU5EXIakFWVx6hCIR8RhL FlwA== 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=Xp4zjy9Wm088y5i2x7edoXR5zY1qvUaDOBqSu0uS4ns=; fh=/w08LdzNt1kNSwWwCVqhlqp7XWsG8pryXQF7MxR0bbE=; b=GQkYk0YM+EtsiSmtYB5rThe/7wW85fB9QhNqZht/f5Vdzwjv3ZYNqssMwA5o0QFOM7 0Mc/888PS6P9sdUIAEiJfZICw8k5lHWfRbyyJdttpT0LVmzRgG16ejQspm+tcOZ1tqwm sdB9CMoRrLq40wrcvsOj9V/D1RQfpPo+SMroz6drvbjct/L0Z3S5rKi0LjxvNgTr3KTu CjDWBN2ZFwgAZvGzgeHmdVWi+B4Yn+fG8kLHO6GIYn3O/XqJxLI6snelQFUscHPDdi7w HxJ+oanOFEOpsM7CmZP7LBNXYoyczdwC0IuU2/32DqfLTLMmGF1wM0pz7fjwmrKk/tn5 sJiw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-crypto+bounces-2475-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2475-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id d7-20020a1709064c4700b00a3ec6800c31si3381026ejw.998.2024.03.03.10.47.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 10:47:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2475-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-crypto+bounces-2475-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2475-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 96A4E1F21350 for ; Sun, 3 Mar 2024 18:47:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42D12763F0; Sun, 3 Mar 2024 18:47:52 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [176.9.242.62]) (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 34A661EB37; Sun, 3 Mar 2024 18:47:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=176.9.242.62 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709491672; cv=none; b=ZQ0NLv63T/ru57qtTg/DrknAtHpZaVMzhJaylDUBDfXqnaf6YYUjaFhLl/OqBmGyzFZZf9/ANbJoBl/KC0petxhHD8Wtcr0PyoZQC/MKu6ou+ORWvi7NHjj3tuwLjjANn0dqH7P7OWFC58N1p/XzowM84c4Kqwj435SIxOKBlLs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709491672; c=relaxed/simple; bh=VWOFm4tp/nqIq4iUaCjVanBK0FPgSR4195k+RyVBmTU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Egi5eowX2kl2rHMkk72CiOZ6syXAdU5MgkEu8Xifmi244qR6vCEse4BS28nQEvycaTY46QRN6poV0o+Ax44UNcKk2vrkK6GtXsPRbArud32QzWvvVweGRx3UTfGAdb8PEt7x+E8jhyFboTjcE1BqW2cwAPzfzxKihFxT1NTwJHY= 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=176.9.242.62 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 bmailout3.hostsharing.net (Postfix) with ESMTPS id 9F536100DA1A6; Sun, 3 Mar 2024 19:47:45 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 6A666353E6; Sun, 3 Mar 2024 19:47:45 +0100 (CET) Date: Sun, 3 Mar 2024 19:47:45 +0100 From: Lukas Wunner To: Stefan Berger Cc: 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 v4 11/12] crypto: asymmetric_keys - Adjust signature size calculation for NIST P521 Message-ID: <20240303184745.GA9392@wunner.de> References: <20240301022007.344948-1-stefanb@linux.ibm.com> <20240301022007.344948-12-stefanb@linux.ibm.com> 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: <20240301022007.344948-12-stefanb@linux.ibm.com> User-Agent: Mutt/1.10.1 (2018-07-13) On Thu, Feb 29, 2024 at 09:20:06PM -0500, Stefan Berger wrote: > Adjust the calculation of the maximum signature size for support of > NIST P521. While existing curves may prepend a 0 byte to their coordinates > (to make the number positive), NIST P521 will not do this since only the > first bit in the most significant byte is used. > > If the encoding of the x & y coordinates requires more than 128 bytes then > an additional byte is needed for the encoding of the length. Take this into > account when calculating the maximum signature size. > > Signed-off-by: Stefan Berger Reviewed-by: Lukas Wunner