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

Name

Description

ctx

Key‐derivation / derive context for a DH key.

pad

Non‐zero to pad the secret to BN_num_bytes(p); 0 to return the minimal big‐endian form.

Created with MrDocs