[#ECDH_compute_key]
= ECDH&lowbar;compute&lowbar;key
:mrdocs:

Perform ECDH and optionally apply a KDF to the shared secret (deprecated)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;deprecated&rsqb;&rsqb;
int
ECDH&lowbar;compute&lowbar;key(
    void* out,
    size&lowbar;t outlen,
    xref:EC_POINT.adoc[EC&lowbar;POINT] const* pub&lowbar;key,
    xref:EC_KEY.adoc[EC&lowbar;KEY] const* ecdh,
    void*(* KDF)(void const*, size&lowbar;t, void*, size&lowbar;t*));
----

[WARNING]
====
https://en.cppreference.com/cpp/language/attributes/deprecated[Deprecated^]. Use of this entity is allowed but discouraged.
====
== Return Value

Number of bytes written to `out` on success, or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *out*
| Buffer that receives the derived key material (or KDF output)&period;
| *outlen*
| Size of `out` in bytes&semi; also passed to `KDF` as initial output capacity&period;
| *pub&lowbar;key*
| Peer&apos;s public EC point&period;
| *ecdh*
| Local private EC&lowbar;KEY used for the agreement&period;
| *KDF*
| Optional key&hyphen;derivation callback&semi; if NULL, copies min(`outlen,` secret length) raw shared secret bytes into `out&period;`
|===


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