Re: [PATCH v4 11/12] crypto: asymmetric_keys - Adjust signature size calculation for NIST P521

Lukas Wunner
2024-03-03T18:47:47Z

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 <stefanb@linux.ibm.com>

Reviewed-by: Lukas Wunner <lukas@wunner.de>