[#DH_meth_set_bn_mod_exp] = DH_meth_set_bn_mod_exp :mrdocs: Set the modular‐exponentiation callback on a DH_METHOD (deprecated). == Synopsis Declared in `<openssl/dh.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[deprecated]] int DH_meth_set_bn_mod_exp( xref:DH_METHOD-0a.adoc[DH_METHOD]* dhm, int(* bn_mod_exp)(xref:DH.adoc[DH] const*, xref:BIGNUM.adoc[BIGNUM]*, xref:BIGNUM.adoc[BIGNUM] const*, xref:BIGNUM.adoc[BIGNUM] const*, xref:BIGNUM.adoc[BIGNUM] const*, xref:BN_CTX.adoc[BN_CTX]*, xref:BN_MONT_CTX.adoc[BN_MONT_CTX]*)); ---- [WARNING] ==== https://en.cppreference.com/cpp/language/attributes/deprecated[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 [cols="1,4"] |=== | Name| Description | *dhm* | Method table to update. | *bn_mod_exp* | Callback implementing modular exponentiation, or NULL to clear (must be non‐NULL when using the default generate_key). |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#