[#BN_mod_sqrt] = BN_mod_sqrt :mrdocs: Compute a modular square root: retˆ2 ≡ a (mod n) when a quadratic residue. == Synopsis Declared in `<openssl/bn.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BIGNUM.adoc[BIGNUM]* BN_mod_sqrt( xref:BIGNUM.adoc[BIGNUM]* ret, xref:BIGNUM.adoc[BIGNUM] const* a, xref:BIGNUM.adoc[BIGNUM] const* n, xref:BN_CTX.adoc[BN_CTX]* ctx); ---- == Return Value Result BIGNUM (possibly `ret),` or NULL if no root exists / on error. == Parameters [cols="1,4"] |=== | Name| Description | *ret* | Destination for the root, or NULL to allocate. | *a* | Value whose square root modulo `n` is requested. | *n* | Odd prime modulus (Tonelli–Shanks style algorithms). | *ctx* | BN_CTX scratch space. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#