EVP_PKEY_CTX_set_dh_pad

Enable or disable leading-zero padding of the DH shared secret to the prime length.

Synopsis

Declared in <openssl/dh.h>

int
EVP_PKEY_CTX_set_dh_pad(
    EVP_PKEY_CTX* ctx,
    int pad);

Return Value

1 on success, or a negative value for unsupported / failure.

Parameters

NameDescription
ctxKey-derivation / derive context for a DH key.
padNon-zero to pad the secret to BN_num_bytes(p); 0 to return the minimal big-endian form.