Derive the DH shared secret with NIST SP 800-56A leading-zero padding (deprecated).
Declared in <openssl/dh.h>
[[deprecated]]
int
DH_compute_key_padded(
unsigned char* key,
BIGNUM const* pub_key,
DH* dh);
Deprecated. Use of this entity is allowed but discouraged.
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.
DH_size(dh) on success, or -1 on error.
| 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. |