[#BN_mod_exp_mont_consttime_x2]
= BN&lowbar;mod&lowbar;exp&lowbar;mont&lowbar;consttime&lowbar;x2
:mrdocs:

Compute two constant&hyphen;time Montgomery modular exponentiations together&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
BN&lowbar;mod&lowbar;exp&lowbar;mont&lowbar;consttime&lowbar;x2(
    xref:BIGNUM.adoc[BIGNUM]* rr1,
    xref:BIGNUM.adoc[BIGNUM] const* a1,
    xref:BIGNUM.adoc[BIGNUM] const* p1,
    xref:BIGNUM.adoc[BIGNUM] const* m1,
    xref:BN_MONT_CTX.adoc[BN&lowbar;MONT&lowbar;CTX]* in&lowbar;mont1,
    xref:BIGNUM.adoc[BIGNUM]* rr2,
    xref:BIGNUM.adoc[BIGNUM] const* a2,
    xref:BIGNUM.adoc[BIGNUM] const* p2,
    xref:BIGNUM.adoc[BIGNUM] const* m2,
    xref:BN_MONT_CTX.adoc[BN&lowbar;MONT&lowbar;CTX]* in&lowbar;mont2,
    xref:BN_CTX.adoc[BN&lowbar;CTX]* ctx);
----

== Return Value

1 on success, or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *rr1*
| Destination for (a1 &circ; p1) mod m1&period;
| *a1*
| First base&period;
| *p1*
| First exponent&period;
| *m1*
| First odd modulus&period;
| *in&lowbar;mont1*
| Optional Montgomery context for `m1,` or NULL&period;
| *rr2*
| Destination for (a2 &circ; p2) mod m2&period;
| *a2*
| Second base&period;
| *p2*
| Second exponent&period;
| *m2*
| Second odd modulus&period;
| *in&lowbar;mont2*
| Optional Montgomery context for `m2,` or NULL&period;
| *ctx*
| BN&lowbar;CTX for temporary storage&period;
|===


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