lkml.org 
[lkml]   [2021]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 03/18] crypto: dh - optimize domain parameter serialization for well-known groups
Date
Hannes Reinecke <hare@suse.de> writes:

> On 12/1/21 1:48 AM, Nicolai Stange wrote:
>> diff --git a/crypto/dh_helper.c b/crypto/dh_helper.c
>> index aabc91e4f63f..a6c9389d8219 100644
>> --- a/crypto/dh_helper.c
>> +++ b/crypto/dh_helper.c
>> @@ -10,7 +10,32 @@
>> #include <crypto/dh.h>
>> #include <crypto/kpp.h>
>> -#define DH_KPP_SECRET_MIN_SIZE (sizeof(struct kpp_secret) + 3 *
>> sizeof(int))
>> +#define DH_KPP_SECRET_MIN_SIZE (sizeof(struct kpp_secret) + \
>> + sizeof(enum dh_group_id) + 3 * sizeof(int))
>
> That is not a good practise; 'enum' doesn't have a defined size, and
> will typically default to 'unsigned int'.
> But this might well be compiler dependent, so I suggest using a fixes
> size here.

Good point, in particular as a certain encoding is assumed for the test
vectors. Changed in v2.

Thanks,

Nicolai

--
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg), GF: Ivo Totev

\
 
 \ /
  Last update: 2021-12-09 10:08    [W:0.068 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site