static int pkey_gost01_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey,int type)
	{
	struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx);
	EC_KEY *ec=NULL;
	if (data->sign_param_nid == NID_undef)
		{
		if (type == NID_id_GostR3410_2001_cc)
			{
			data->sign_param_nid = NID_id_GostR3410_2001_ParamSet_cc;
			}
		else {	
			GOSTerr(GOST_F_PKEY_GOST01_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,type,ec);
	return 1;
	}