[#DH_meth_set_bn_mod_exp]
= DH&lowbar;meth&lowbar;set&lowbar;bn&lowbar;mod&lowbar;exp
:mrdocs:

Set the modular&hyphen;exponentiation callback on a DH&lowbar;METHOD (deprecated)&period;

== Synopsis

Declared in `&lt;openssl&sol;dh&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;deprecated&rsqb;&rsqb;
int
DH&lowbar;meth&lowbar;set&lowbar;bn&lowbar;mod&lowbar;exp(
    xref:DH_METHOD-0a.adoc[DH&lowbar;METHOD]* dhm,
    int(* bn&lowbar;mod&lowbar;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&lowbar;CTX]*, xref:BN_MONT_CTX.adoc[BN&lowbar;MONT&lowbar;CTX]*));
----

[WARNING]
====
https://en.cppreference.com/cpp/language/attributes/deprecated[Deprecated^]. Use of this entity is allowed but discouraged.
====
== Description

The callback computes r &equals; a&circ;p mod m and is used by the default DH&lowbar;generate&lowbar;key() implementation&period; Prefer provider APIs for new code&period;

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dhm*
| Method table to update&period;
| *bn&lowbar;mod&lowbar;exp*
| Callback implementing modular exponentiation, or NULL to clear (must be non&hyphen;NULL when using the default generate&lowbar;key)&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
