[#BN_are_coprime]
= BN&lowbar;are&lowbar;coprime
:mrdocs:

Test whether `a` and `b` are coprime (gcd &equals;&equals; 1), possibly mutating `a&period;`

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
BN&lowbar;are&lowbar;coprime(
    xref:BIGNUM.adoc[BIGNUM]* a,
    xref:BIGNUM.adoc[BIGNUM] const* b,
    xref:BN_CTX.adoc[BN&lowbar;CTX]* ctx);
----

== Return Value

1 if gcd(&verbar;`a&verbar;,&verbar;b&verbar;)` &equals;&equals; 1, 0 if not coprime, or a negative value on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *a*
| First value&semi; may be overwritten as a scratch during the gcd&period;
| *b*
| Second value (not modified)&period;
| *ctx*
| BN&lowbar;CTX scratch space&period;
|===


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