[#BN_is_prime]
= BN&lowbar;is&lowbar;prime
:mrdocs:

Probable&hyphen;primality test without trial division (deprecated&semi; prefer BN&lowbar;check&lowbar;prime())&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;deprecated&rsqb;&rsqb;
int
BN&lowbar;is&lowbar;prime(
    xref:BIGNUM.adoc[BIGNUM] const* p,
    int nchecks,
    void(* callback)(int, int, void*),
    xref:BN_CTX.adoc[BN&lowbar;CTX]* ctx,
    void* cb&lowbar;arg);
----

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

1 if probably prime, 0 if composite, or &hyphen;1 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *p*
| Candidate integer&period;
| *nchecks*
| Number of Miller&hyphen;Rabin rounds (or BN&lowbar;prime&lowbar;checks for a size&hyphen;based default)&period;
| *callback*
| Optional old&hyphen;style progress callback, or NULL&period;
| *ctx*
| BN&lowbar;CTX for temporaries, or NULL&period;
| *cb&lowbar;arg*
| User pointer passed to `callback&period;`
|===


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