lkml.org 
[lkml]   [2020]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 5/5] crypto: hisilicon/hpre - add 'CURVE25519' algorithm
From
Date

> Am Freitag, den 11.12.2020, 14:30 +0800 schrieb Meng Yu:
>>
>> +/* curve25519 */
>> +static u64 curve25519_g_x[] = { 0x0000000000000009, 0x0000000000000000,
>> +                               0x0000000000000000, 0x0000000000000000 };
>> +static u64 curve25519_p[] = { 0xffffffffffffffed, 0xffffffffffffffff,
>> +                               0xffffffffffffffff, 0x7fffffffffffffff };
>> +static u64 curve25519_a[] = { 0x000000000001DB41, 0x0000000000000000,
>> +                               0x0000000000000000, 0x0000000000000000 };
>> +static const struct ecc_curve ecc_25519 = {
>> +       .name = "curve25519",
>> +       .g = {
>> +               .x = curve25519_g_x,
>> +               .ndigits = 4,
>> +       },
>> +       .p = curve25519_p,
>> +       .a = curve25519_a,
>> +};
>
> With this definition, I am not sure whether ecc_is_pubkey_valid_partial would
> work correctly. At least it *seems* that there would be a NULL-pointer
> dereference in vli_add with the undefined .b value. Did you test and can you
> confirm?
>
> Thanks
> Stephan
>

'static const struct ecc_curve ecc_25519' is curve25519's parameters,
only used in 'curve25519', not used by 'ECDH';

Thanks,

\
 
 \ /
  Last update: 2020-12-16 03:46    [W:0.210 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site