Compute the modular inverse of a modulo n.
Declared in <openssl/bn.h>
BIGNUM*
BN_mod_inverse(
BIGNUM* ret,
BIGNUM const* a,
BIGNUM const* n,
BN_CTX* ctx);
Result BIGNUM (possibly newly allocated) on success, or NULL if no inverse exists / on error.
| Name | Description |
|---|---|
| ret | Existing BIGNUM to receive the result, or NULL to allocate. |
| a | Value to invert. |
| n | Modulus; must be non-zero. |
| ctx | BN_CTX scratch space. |