在sm2evptest.c文件中,调用test_evp_pkey_encrypt函数时传入的参数EVP_PKEY是由EVP_PKEY_keygen函数生成的,当我尝试通过公钥和私钥来生成EC_KEY,然后再将EC_KEY封装成EVP_PKEY传递给test_evp_pkey_encrypt函数时,调用EVP_PKEY_encrypt函数进行加密就会报出如下错误: 4559156160:error:1007C06B:elliptic curve routine...
4、;if ( (EVP_PKEY_paramgen_init(pctx) != 1 )goto clean_up;if ( (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, NID_sm2) = 0 )goto clean_up;if ( (EVP_PKEY_keygen_init(pctx) != 1 )goto clean_up;if ( (EVP_PKEY_keygen(pctx, &pkey) != 1 )goto clean_up;/* print ...
(pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL)) ) { goto clean_up; } if ( (EVP_PKEY_paramgen_init(pctx)) != 1 ) { goto clean_up; } if ( (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, NID_sm2)) <= 0 ) { goto clean_up; } if ( (EVP_PKEY_keygen_init(pctx))...
File: sm2.c Project: BeyondChallenge/GmSSL int main() { int ret = -1; int verbose = 0; BIO *out = NULL; int id = EVP_PKEY_SM2; const EVP_MD *md = EVP_sm3(); ENGINE *engine = NULL; EVP_PKEY_CTX *pkctx = NULL; EVP_PKEY *pkey = NULL; EVP_MD_CTX *mdctx = NULL...
Don't restrict what EVP_PKEY_Q_keygen can be used for a57c6f8 Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment Labels approval: doneThis pull request has the required number of approvalsbranch: masterMerge to master branchtests: deferredTests ...
* ignored. Some EVP_PKEY types cannot do this. */EVP_PKEY_copy_parameters(pkey, c->pkeys[i].privatekey); ERR_clear_error();#ifndefOPENSSL_NO_RSA/* * Don't check the public/private key, this is mostly for smart * cards. */if(EVP_PKEY_id(c->pkeys[i].privatekey) == EVP_PKEY...
int main() { int ret = -1; int verbose = 0; BIO *out = NULL; int id = EVP_PKEY_SM2; const EVP_MD *md = EVP_sm3(); ENGINE *engine = NULL; EVP_PKEY_CTX *pkctx = NULL; EVP_PKEY *pkey = NULL; EVP_MD_CTX *mdctx = NULL; EVP_CIPHER_CTX *cpctx = NULL; unsigned char...
if ( (EVP_PKEY_paramgen_init(pctx)) != 1 ){ goto clean_up;} if ( (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(pctx, NID_sm2)) <= 0 ){ goto clean_up;} if ( (EVP_PKEY_keygen_init(pctx)) != 1 ){ goto clean_up;} if ( (EVP_PKEY_keygen(pctx, &pkey)) != 1 ){ got...
macopt = sk_OPENSSL_STRING_value(macopts, i);if(pkey_ctrl_string(mac_ctx, macopt) <=0) { BIO_printf(bio_err,"MAC parameter error \"%s\"\n", macopt); ERR_print_errors(bio_err);gotomac_end; } } }if(EVP_PKEY_keygen(mac_ctx, &sigkey) <=0) { ...
EVP_PKEY *ret = NULL; EVP_PKEY_CTX *pkctx = NULL; pkctx = EVP_PKEY_CTX_new_id(EVP_PKEY_SM2, NULL);//创建sm2 上下文 if(pkctx==NULL){ errorL("EVP_PKEY_CTX_new_id"); return; } int retV=1; retV=EVP_PKEY_keygen_init(pkctx);//初始化sm2 上下文 ...