DH_meth_set_bn_mod_exp

Set the modular-exponentiation callback on a DH_METHOD (deprecated).

Synopsis

Declared in <openssl/dh.h>

[[deprecated]]
int
DH_meth_set_bn_mod_exp(
    DH_METHOD* dhm,
    int(* bn_mod_exp)(DH const*, BIGNUM*, BIGNUM const*, BIGNUM const*, BIGNUM const*, BN_CTX*, BN_MONT_CTX*));

WARNING

Deprecated. Use of this entity is allowed but discouraged.

Description

The callback computes r = a^p mod m and is used by the default DH_generate_key() implementation. Prefer provider APIs for new code.

Return Value

1 on success, or 0 on failure.

Parameters

NameDescription
dhmMethod table to update.
bn_mod_expCallback implementing modular exponentiation, or NULL to clear (must be non-NULL when using the default generate_key).