【发布时间】:2018-06-26 20:07:36
【问题描述】:
我正在尝试生成并使用 openssl 椭圆曲线。运行这个:从文档中
EC_GROUP *curve;
if(NULL == (curve = EC_GROUP_new_by_curve_name(NID_secp224r1)))
handleErrors();
EC_KEY *key;
if(NULL == (key = EC_KEY_new_by_curve_name(NID_secp224r1)))
handleErrors();
if(1 != EC_KEY_generate_key(key)) handleErrors();
这些包括:
#include <openssl/obj_mac.h>
#include <openssl/ec.h>
#include <openssl/bn.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
我查看了 ec.h 文件,它具有我正在调用的功能。我的错误是这样的:
key_gen.c:(.text+0x15): undefined reference to `EC_GROUP_new_by_curve_name'
key_gen.c:(.text+0x2a): undefined reference to `handleErrors'
key_gen.c:(.text+0x34): undefined reference to `EC_KEY_new_by_curve_name'
key_gen.c:(.text+0x49): undefined reference to `handleErrors'
key_gen.c:(.text+0x55): undefined reference to `EC_KEY_generate_key'
key_gen.c:(.text+0x64): undefined reference to `handleErrors'
我还需要包含更多内容吗?
【问题讨论】:
标签: c openssl cryptography signature elliptic-curve