Closed kevinhewanjun closed 3 years ago
hi,完全copy官网的代码测试SM9功能,在keygen的时候返回NULL,希望得到帮助,谢谢!
<<<<<<<<<<<<<<< int testSM9() { int err = 1; int curve_id = NID_sm2p256v1; //FIXME //int curve_id = NID_sm2sign; char id = "guanzhi1980@gmail.com"; char in = "message to be signed or encrypted"; SM9PublicParameters mpk = NULL; SM9MasterSecret msk = NULL; SM9PrivateKey sk = NULL; unsigned char dgst[32] = { 0x01, 0x00 }; unsigned char c = NULL; unsigned char m = NULL; unsigned char sig = NULL; size_t clen, mlen, siglen;
/* setup */ if (!SM9_setup_by_pairing_name(curve_id, SM9_HID_SIGN, &mpk, &msk)) { goto end; } /* keygen */ if (!(sk = SM9_extract_private_key(mpk, msk, id, strlen(id)))) { goto end; }
<<<<<<<<<<<<<<<<<<
出错的地方sm9_keygen.c文件中位置: <<<<<<<<<<<<<<<
/* EC_GROUP */ if (!(group = EC_GROUP_new_type1curve_ex(mpk->p, mpk->a, mpk->b, mpk->pointP1->data, mpk->pointP1->length, mpk->order, mpk->cofactor, bn_ctx))) { SM9err(SM9_F_SM9_EXTRACT_PRIVATE_KEY, SM9_R_INVALID_TYPE1CURVE); goto end; }
<<<<<<<<<<<<<<<
SM9尚未正式支持!敬请期待
好的,谢谢你们无私的奉献
@guanzhi guan老师,请问sm9什么时候能正式支持?
主分支已经全面支持SM9的全部算法和推荐参数
谢谢你们无私的奉献
Marked as stale issue. Will be closed later if no activity for a while.
hi,完全copy官网的代码测试SM9功能,在keygen的时候返回NULL,希望得到帮助,谢谢!
<<<<<<<<<<<<<<< int testSM9() { int err = 1; int curve_id = NID_sm2p256v1; //FIXME //int curve_id = NID_sm2sign; char id = "guanzhi1980@gmail.com"; char in = "message to be signed or encrypted"; SM9PublicParameters mpk = NULL; SM9MasterSecret msk = NULL; SM9PrivateKey sk = NULL; unsigned char dgst[32] = { 0x01, 0x00 }; unsigned char c = NULL; unsigned char m = NULL; unsigned char sig = NULL; size_t clen, mlen, siglen;
<<<<<<<<<<<<<<<<<<
出错的地方sm9_keygen.c文件中位置: <<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<