 unverifiable g use &quot;hindex&quot; instead of &quot;gindex&quot;
 * extra_params[1] = OSSL_PARAM_construct_int(&quot;hindex&quot;, &amp;hindex);
 */
extra_params[1] = OSSL_PARAM_construct_int(&quot;gindex&quot;, &amp;gindex);
extra_params[2] = OSSL_PARAM_construct_int(&quot;pcounter&quot;, &amp;pcounter);
extra_params[3] = OSSL_PARAM_construct_end();
merged_params = OSSL_PARAM_merge(domain_params, extra_params);

ctx = EVP_PKEY_CTX_new_from_name(NULL, &quot;DHX&quot;, NULL);
EVP_PKEY_fromdata_init(ctx);