From: Laveesh Bansal <laveeshb@laveeshbansal.com>
To: Arun Iyengar <aiyengar1990@gmail.com>
Cc: Lukas Wunner <lukas@wunner.de>, Ignat Korchagin <ignat@linux.win>,
Stefan Berger <stefanb@linux.ibm.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Jarkko Sakkinen <jarkko@kernel.org>,
Erwin Pawliczek <pawliczekerwin@gmail.com>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] crypto: ecc - Fix P-521 scalar multiplication for small scalars
Date: Sun, 22 Nov 2026 19:37:05 -0800 [thread overview]
Message-ID: <20261123033705.91056-1-laveeshb@laveeshbansal.com> (raw)
In-Reply-To: <20261114-ecc-p521-small-scalars-v1-2-7b114f076b33@gmail.com>
On Sat, 14 Nov 2026, Arun Iyengar wrote:
> No caller is affected today: the only P-521 caller,
> ecc_is_pubkey_valid_full(), passes k = n.
Hi Arun,
"No caller is affected" holds for the results, but for k = n
ecc_is_pubkey_valid_full() now runs the ladder on 2n instead of 3n, as
P-192, P-256 and P-384 already do. The ecdsa-nist-p521 self-test covers
that path and still passes. It might be worth a line in the commit
message.
I tested the series on an arm64 QEMU guest (7.4.0-rc1, Herbert's tree at
8ba9044ff0bf, KASAN, lockdep and DEBUG_LIST), calling
ecc_make_pub_key() on P-521 for 76 keys, three times each, and comparing
with OpenSSL. With patch 1 alone every key below 2^522 - 2n (42 of 76)
gives the wrong point. With both patches all 76 match. There are no
KASAN or lockdep reports.
Please consider adding a KUnit test for P-521 key generation. Nothing
covers that path today, and a test would have caught both of these bugs.
Tested-by: Laveesh Bansal <laveeshb@laveeshbansal.com>
Thanks,
Laveesh
prev parent reply other threads:[~2026-11-23 3:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 8:44 [PATCH 0/2] crypto: ecc - Fix P-521 public key generation Arun Iyengar via B4 Relay
2026-11-14 8:44 ` [PATCH 1/2] crypto: ecc - Keep the random initial Z below 2^521 on P-521 Arun Iyengar via B4 Relay
2026-11-23 3:36 ` Laveesh Bansal
2026-11-14 8:44 ` [PATCH 2/2] crypto: ecc - Fix P-521 scalar multiplication for small scalars Arun Iyengar via B4 Relay
2026-11-23 3:37 ` Laveesh Bansal [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261123033705.91056-1-laveeshb@laveeshbansal.com \
--to=laveeshb@laveeshbansal.com \
--cc=aiyengar1990@gmail.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=ignat@linux.win \
--cc=jarkko@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=pawliczekerwin@gmail.com \
--cc=stefanb@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®