Document the BN library.
[openssl.git] / doc / crypto / BN_mod_inverse.pod
1 =pod
2
3 =head1 NAME
4
5 BN_mod_inverse - Compute inverse modulo n
6
7 =head1 SYNOPSIS
8
9  #include <openssl/bn.h>
10
11  BIGNUM *BN_mod_inverse(BIGNUM *r, BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
12
13 =head1 DESCRIPTION
14
15 BN_mod_inverse() computes the inverse of B<a> modulo B<n>
16 places the result in B<r> (C<(a*r)%n==1>). If B<r> is NULL,
17 a new B<BIGNUM> is created.
18
19 B<ctx> is a previously allocated B<BN_CTX> used for temporary
20 variables. B<r> may be the same B<BIGNUM> as B<a> or B<n>.
21
22 =head1 RETURN VALUES
23
24 BN_mod_inverse() returns the B<BIGNUM> containing the inverse, and
25 NULL on error. The error codes can be obtained by ERR_get_error(3).
26
27 =head1 SEE ALSO
28
29 bn(3), err(3), BN_add(3)
30
31 =head1 HISTORY
32
33 BN_mod_inverse() is available in all versions of SSLeay and OpenSSL.
34
35 =cut