[gnutls-help] Generating EC key with GnuTLS

Nikos Mavrogiannopoulos n.mavrogiannopoulos at gmail.com
Wed May 11 23:08:01 CEST 2016


On Wed, 2016-05-11 at 12:52 +0300, Aki Tuomi wrote:
> I am trying to use GnuTLS library to generate EC key with following
> code:
> 
>   int ec;
>   gnutls_privkey_t priv;
>   const char *curve = "secp521r1";
>   gnutls_pk_algorithm_t pk_algo;
>   gnutls_ecc_curve_t pk_curve;
>   int bits;
>   pk_curve = gnutls_ecc_curve_get_id(curve);
>   bits = GNUTLS_CURVE_TO_BITS(curve);

You have a typo on that line. Use pk_curve.

regards,
Nikos




More information about the Gnutls-help mailing list