I resolved my previous problem, the error came in the name of the
variable "key" which has to be named "eckey". So there is a mistake in
the code in the documentation.

Now my problem is more difficult, because after :

Initialization of the structure :
EC_KEY    *eckey =  EC_KEY_new()
link with an elliptic curve :
eckey = EC_GROUP_new_by_curve_name(NID_secp192k1);
finally, the creation of this key :
if (!EC_KEY_generate_key(eckey))
       {
        printf("error key generation\n");
       }

when I execute my code, I get a Semgentation Fault and gdb tell me
that the problem comes with the  function :  BN_copy()

Program received signal SIGSEGV, Segmentation fault.
0x0805fee8 in BN_copy ()

I am working with ubuntu and the libssl0.9.8g-10

Thanks in advance for your help,

Romain Hinfray


On Mon, Mar 2, 2009 at 2:57 PM, neorom <[email protected]> wrote:
> Hello every body,
>
> I'm new on this mailing list. I actually have to do a small program
> which have to generate signature with the ecdsa algorithm and I have
> never did it before.
> For this I saw the documentation and the example on the openssl web
> site (http://www.openssl.org/docs/crypto/ecdsa.html).
>
> But on line 8 of this program : key->group = 
> EC_GROUP_new_by_nid(NID_secp192k1);
> , I don't understood why the "key" structure isn't initialized before
> and with struture defines it. Gcc tells me that :  error: ‘key’
> undeclared.
>
> Can you help me please.
>
> Thanks in advance
>
> Romain Hinfray
>
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to