Re: [RFC PATCH 5/8] KEYS: Provide software public key query function [ver 3]

From: Tadeusz Struk
Date: Wed May 11 2016 - 20:18:30 EST


On 05/11/2016 04:50 PM, Mat Martineau wrote:
>
>> + len = crypto_akcipher_maxsize(tfm);
>> + info->key_size = len * 8;
>> + info->max_data_size = len;
>> + info->max_sig_size = len;
>> + info->max_enc_size = len;
>> + info->max_dec_size = len;
>
> If len > UINT16_MAX, should UINT16_MAX be reported as the max size? Similar question for len*8 and key_size.

Hi Mat,
Since all the operations performed are mod key->n the output will never be bigger
than size of pkey->n, which is the return value from crypto_akcipher_maxsize(tfm)
for a given key.
Thanks,
--
TS