[#BN_nist_mod_521]
= BN&lowbar;nist&lowbar;mod&lowbar;521
:mrdocs:

Fast reduction of `a` modulo the NIST P&hyphen;521 prime&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
BN&lowbar;nist&lowbar;mod&lowbar;521(
    xref:BIGNUM.adoc[BIGNUM]* r,
    xref:BIGNUM.adoc[BIGNUM] const* a,
    xref:BIGNUM.adoc[BIGNUM] const* p,
    xref:BN_CTX.adoc[BN&lowbar;CTX]* ctx);
----

== Return Value

1 on success, or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *r*
| Destination (may equal `a)&period;`
| *a*
| Value to reduce (non&hyphen;negative)&period;
| *p*
| Must be the NIST P&hyphen;521 prime (unused for the fast path but retained for API shape)&period;
| *ctx*
| BN&lowbar;CTX scratch space (may be unused)&period;
|===


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