Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1496501lqg; Sun, 3 Mar 2024 13:03:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXMzkbpp4bpjL+PEst4XlHbovSJG9i2UECv5uPX9yf9tZmdLpD87On9FsUcTwyrYEqx/3jOsA7Bnw9kg16WhSfGxdyvRk3acNPtAsk3Gg== X-Google-Smtp-Source: AGHT+IEfutavgVDa+wwvn04VhdUcnZ1aBi/CVnHtVpkoShMTue/871asxiBBO0DI+toZ2J2U9gfU X-Received: by 2002:a05:6e02:148e:b0:365:1d36:91d7 with SMTP id n14-20020a056e02148e00b003651d3691d7mr11580202ilk.27.1709499802126; Sun, 03 Mar 2024 13:03:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709499802; cv=pass; d=google.com; s=arc-20160816; b=Gth18qS0rZlJflEZHu3tSsKEUJHoFuiRk1OfAn/PDKqyZfdNh2k/jMFjvhdv4Km35w A4xmf6PghumZt2WRbNfFWs0vahTlc8zA3aWlO3QOvMQJYxOq35hCvPQT0gcGClNR8u0/ Ss9Kw0whgl3BJH3d94RHnhFHeNIJdgX2RkzcYjk1Oi6LTQ6ZVwT8FeTPdWI0XS0Wr0mY JmuXArsODAy6f8ifpoKrYgbwYqj65K96hSO2cm2BVfY/6eQJYNDB8JGqM8xegA1rzSNg B79yP7E2kCvdz4Q9zk2/Yrj+9FrI7Fr20cBjUmZ8OcBZChIZN1vagGEwwRR7ye0nOc4u up9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=1O7XTeLo80WEdjsYTG8xbnDjbah2VcPOv5sifLZlx30=; fh=oaC6g1rvngpUy3NBPUH3HwPaOzR9292cM7qLBeN9XRU=; b=niERmHraT+9eiWm1t1r+vU/YOLsijlRbnr9DjuxsnJwMhleP0+V9mC77LRl/2rrP6d Tl/ZU8tMUIqz2PjoKsP+PG6D1QwhPftZyBwqZ9/AXqoqXu74XqDHFP72lv3dLwQz3wPA o85LTq9om0NlQGld1OtAVeIQedo3yRsPFzNko5IKls99+aMfWx/DzciADkpQ43wX9gNB Ypk7HVU3HKkufof4zpJiC5DLHz7MnZUfALD0byhKWOCpK/A7g8GWF3PIrU4AkZNe8gNM i+pMfHYYYM2zVSuH+iIUsr8ksbH0zy7nPAUIHTAkBkeHKQEp1sd8En3BbHMPVlbeR21t sBYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=ODy+0TXT; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-crypto+bounces-2476-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2476-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u6-20020a634546000000b005dbdc98c15csi7255686pgk.709.2024.03.03.13.03.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 13:03:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-2476-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=ODy+0TXT; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-crypto+bounces-2476-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-2476-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com 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 765B328106E for ; Sun, 3 Mar 2024 21:03:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26E9B79DCC; Sun, 3 Mar 2024 21:03:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="ODy+0TXT" X-Original-To: linux-crypto@vger.kernel.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 163C52F844; Sun, 3 Mar 2024 21:03:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709499796; cv=none; b=UmObmAb96x9FXVgdNPOTE+H4A/fQsqgn/t7awUL5fSqYzNhsigvaUt2U+QwjFIj4CG+YeXk9t5LXw3XvPT7QX5kaXa2aPx/TjxXgoWrkYiDcF6az7omY1TBXDiiHs1UrwxxiqTWxrn1+rTk7GunCKKUNBYwPxXxn2Is6D4eYOCI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709499796; c=relaxed/simple; bh=Q1SlwDX2IPHS63/TeBvyFRgdP7QEewyNH57bHy4Jg+0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BEECHYi6FFX8dYp63Ug5/zrbNre6fWUsfjYLkxoIcHYcLAqCm2+VjpmltwqSrpystzBviJz/i1wLGnDMWFxD7WJrOgz3QivhN3eQGwxXdp8YN5f+lJbMFOnWW6NdKmZhV0PUTtPfcBiHwGyuB5GcYS0GP4K5ycij7UpXuzuLKwY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=ODy+0TXT; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 423KWKDb012105; Sun, 3 Mar 2024 21:03:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=1O7XTeLo80WEdjsYTG8xbnDjbah2VcPOv5sifLZlx30=; b=ODy+0TXTIVuv//Eh1lRYBkiFzQZY9UH8a1YRWsYpAhgO8Y05nHgu8HryhXRGj2ePKtLh 77SkuSAejLTjPJBaFKvOzbQAqraL7+0P37Q4OF9gMk2s7rq9/dHzQXNTT70sqoN/VNll N/pjvz37PnmL2mHzSJxigmErDbHUsFRwWZYJAk9pCz/5kdk/wcKBTJsh7V8B43uddvtP s8VbRRj7LoZy3LZ2spLwHDH9VIIafnJCEdLwJDOZeitB9MM+48vr8SJZrB/8g/C5/6Os SaObH4V9P59eVfLYC0X9EMlpXbYOBfqzv9bhVDVmu0LGLUbIW1mDcCCMTUat6VEaFdyA sw== Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3wn0b0gehf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 03 Mar 2024 21:03:07 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 423IEN9R010910; Sun, 3 Mar 2024 21:03:07 GMT Received: from smtprelay05.wdc07v.mail.ibm.com ([172.16.1.72]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3wmh51v375-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 03 Mar 2024 21:03:07 +0000 Received: from smtpav01.wdc07v.mail.ibm.com (smtpav01.wdc07v.mail.ibm.com [10.39.53.228]) by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 423L34wd14942878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 3 Mar 2024 21:03:06 GMT Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 436EB58070; Sun, 3 Mar 2024 21:03:04 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 393AF58055; Sun, 3 Mar 2024 21:03:03 +0000 (GMT) Received: from [9.47.158.152] (unknown [9.47.158.152]) by smtpav01.wdc07v.mail.ibm.com (Postfix) with ESMTP; Sun, 3 Mar 2024 21:03:03 +0000 (GMT) Message-ID: <24151f46-e7b3-434b-88e3-b53ac783eb13@linux.ibm.com> Date: Sun, 3 Mar 2024 16:03:02 -0500 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 11/12] crypto: asymmetric_keys - Adjust signature size calculation for NIST P521 Content-Language: en-US To: Lukas Wunner 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 References: <20240301022007.344948-1-stefanb@linux.ibm.com> <20240301022007.344948-12-stefanb@linux.ibm.com> <20240303184745.GA9392@wunner.de> From: Stefan Berger In-Reply-To: <20240303184745.GA9392@wunner.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 01j3a4jF8HoaSlz1sMeq-Ray_McknfV9 X-Proofpoint-GUID: 01j3a4jF8HoaSlz1sMeq-Ray_McknfV9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-03_11,2024-03-01_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 mlxlogscore=872 phishscore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 spamscore=0 bulkscore=0 malwarescore=0 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403030178 On 3/3/24 13:47, Lukas Wunner wrote: > 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 > Thanks. I have to adjust the commit text and comment in the patch, though. It should be '... requires at least 128 bytes then ...'