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

Stefan Berger
2024-03-03T21:03:14Z

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 <stefanb@linux.ibm.com>
>
> Reviewed-by: Lukas Wunner <lukas@wunner.de>
>
Thanks. I have to adjust the commit text and comment in the patch,
though. It should be '... requires at least 128 bytes then ...'