[#DH_compute_key_padded] = DH_compute_key_padded :mrdocs: Derive the DH shared secret with NIST SP 800‐56A leading‐zero padding (deprecated). == Synopsis Declared in `<openssl/dh.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[deprecated]] int DH_compute_key_padded( unsigned char* key, xref:BIGNUM.adoc[BIGNUM] const* pub_key, xref:DH.adoc[DH]* dh); ---- [WARNING] ==== https://en.cppreference.com/cpp/language/attributes/deprecated[Deprecated^]. Use of this entity is allowed but discouraged. ==== == Description Like DH_compute_key() but always writes DH_size(`dh)` bytes, retaining leading zeros (constant‐time w.r.t. the secret length). Prefer EVP_PKEY_derive for new code. == Return Value DH_size(`dh)` on success, or ‐1 on error. == Parameters [cols="1,4"] |=== | Name| Description | *key* | Output buffer of at least DH_size(`dh)` bytes. | *pub_key* | Peer public value. | *dh* | DH object holding the private key and domain parameters. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#