[openssl-users] Naive: how to generate EC public key from EC private key?
Blumenthal, Uri - 0553 - MITLL
uri at ll.mit.edu
Mon Mar 21 03:01:16 UTC 2016
Viktor and Jeffrey,
Thank you! Now I understand. And it works. ;)
--
Regards,
Uri Blumenthal
On 3/20/16, 22:38, "openssl-users on behalf of Viktor Dukhovni"
<openssl-users-bounces at openssl.org on behalf of
openssl-users at dukhovni.org> wrote:
>
>> On Mar 20, 2016, at 10:32 PM, Blumenthal, Uri - 0553 - MITLL
>><uri at ll.mit.edu> wrote:
>>
>> dup_ekey = EVP_PKEY_get1_EC_KEY(pubkey);
>> group = (EC_GROUP*) EC_KEY_get0_group(dup_ekey);
>
>Declare the group as:
>
> const EC_GROUP *group;
>
>Then:
>
> group = EC_KEY_get0_group();
>
>> nid = EC_GROUP_get_curve_name(group);
>> printf("wrap: Deriving ECC keys over curve \"%s\"\n",
>> EC_curve_nid2nist(nid));
>
>This is fine.
>
>
>> EC_GROUP_free(group);
>
>This is very wrong. You're not supposed to free the group.
>Note the "get0_group", you're not getting a copy...
>
>--
> Viktor.
>
>--
>openssl-users mailing list
>To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
More information about the openssl-users
mailing list