static int pkey_gost01cp_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
	{
	struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx);
	EC_KEY *ec=NULL;
	if (data->sign_param_nid == NID_undef)
		{
			GOSTerr(GOST_F_PKEY_GOST01CP_KEYGEN,
				GOST_R_NO_PARAMETERS_SET);
			return 0;
		}
	ec = EC_KEY_new();
	if (!fill_GOST2001_params(ec,data->sign_param_nid))
		{
		EC_KEY_free(ec);
		return 0;
		}
	gost2001_keygen(ec);

	EVP_PKEY_assign(pkey,NID_id_GostR3410_2001,ec);
	return 1;
	}