]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/BN_mod_inverse.pod
Add d2i_KeyParams/i2d_KeyParams API's.
[thirdparty/openssl.git] / doc / man3 / BN_mod_inverse.pod
CommitLineData
dd8dec69
UM
1=pod
2
3=head1 NAME
4
4d524e10 5BN_mod_inverse - compute inverse modulo n
dd8dec69
UM
6
7=head1 SYNOPSIS
8
9 #include <openssl/bn.h>
10
4d524e10 11 BIGNUM *BN_mod_inverse(BIGNUM *r, BIGNUM *a, const BIGNUM *n,
e9b77246 12 BN_CTX *ctx);
dd8dec69
UM
13
14=head1 DESCRIPTION
15
16BN_mod_inverse() computes the inverse of B<a> modulo B<n>
17places the result in B<r> (C<(a*r)%n==1>). If B<r> is NULL,
18a new B<BIGNUM> is created.
19
20B<ctx> is a previously allocated B<BN_CTX> used for temporary
21variables. B<r> may be the same B<BIGNUM> as B<a> or B<n>.
22
23=head1 RETURN VALUES
24
25BN_mod_inverse() returns the B<BIGNUM> containing the inverse, and
9b86974e 26NULL on error. The error codes can be obtained by L<ERR_get_error(3)>.
dd8dec69
UM
27
28=head1 SEE ALSO
29
9e183d22 30L<ERR_get_error(3)>, L<BN_add(3)>
dd8dec69 31
e2f92610
RS
32=head1 COPYRIGHT
33
9e183d22 34Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
e2f92610 35
4746f25a 36Licensed under the Apache License 2.0 (the "License"). You may not use
e2f92610
RS
37this file except in compliance with the License. You can obtain a copy
38in the file LICENSE in the source distribution or at
39L<https://www.openssl.org/source/license.html>.
40
41=cut