[#EVP_PKEY_CTX_set_ecdh_cofactor_mode]
= EVP&lowbar;PKEY&lowbar;CTX&lowbar;set&lowbar;ecdh&lowbar;cofactor&lowbar;mode
:mrdocs:

Set whether ECDH key agreement multiplies by the curve cofactor&period;

== Synopsis

Declared in `&lt;openssl&sol;ec&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
EVP&lowbar;PKEY&lowbar;CTX&lowbar;set&lowbar;ecdh&lowbar;cofactor&lowbar;mode(
    xref:EVP_PKEY_CTX.adoc[EVP&lowbar;PKEY&lowbar;CTX]* ctx,
    int cofactor&lowbar;mode);
----

== Return Value

1 on success, or a negative value on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Key context configured for ECDH&period;
| *cofactor&lowbar;mode*
| 1 to enable cofactor ECDH, 0 to disable, or &hyphen;1 to reset to the default&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
