Re: [PATCH 1/2] crypto: ecc - Keep the random initial Z below 2^521 on P-521

From: Laveesh Bansal

Date: Sun Nov 22 2026 - 22:37:26 EST


On Sat, 14 Nov 2026, Arun Iyengar wrote:
> With a 576-bit Z, every P-521 ecc_make_pub_key()
> call returns -EAGAIN.

Hi Arun,

I tested this on an arm64 QEMU guest (7.4.0-rc1, Herbert's tree at
8ba9044ff0bf, KASAN, lockdep and DEBUG_LIST). A module calls
ecc_make_pub_key() on P-521 for 76 keys, three times each, and compares
the result with OpenSSL. Without the patch all 228 calls return -EAGAIN.
With it none do, and the 34 keys from 2^522 - 2n up match OpenSSL. The
42 smaller ones are still wrong until patch 2. KASAN and lockdep stay
quiet.

Tested-by: Laveesh Bansal <laveeshb@xxxxxxxxxxxxxxxxx>

Thanks,
Laveesh