Skip to content

Commit

Permalink
Rename the modulus from n into m
Browse files Browse the repository at this point in the history
This matches what other pages use. Also rewrite the definition of the
modular inverse to be less ugly.
  • Loading branch information
botovq committed Oct 19, 2023
1 parent f2babcd commit 09d458b
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions lib/libcrypto/man/BN_mod_inverse.3
@@ -1,4 +1,4 @@
.\" $OpenBSD: BN_mod_inverse.3,v 1.11 2021/11/30 18:34:35 tb Exp $
.\" $OpenBSD: BN_mod_inverse.3,v 1.12 2023/10/19 19:17:46 tb Exp $
.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
.\"
.\" This file was written by Ulf Moeller <ulf@openssl.org>.
Expand Down Expand Up @@ -48,44 +48,47 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd $Mdocdate: November 30 2021 $
.Dd $Mdocdate: October 19 2023 $
.Dt BN_MOD_INVERSE 3
.Os
.Sh NAME
.Nm BN_mod_inverse
.Nd compute inverse modulo n
.Nd compute inverse modulo m
.Sh SYNOPSIS
.In openssl/bn.h
.Ft BIGNUM *
.Fo BN_mod_inverse
.Fa "BIGNUM *r"
.Fa "const BIGNUM *a"
.Fa "const BIGNUM *n"
.Fa "const BIGNUM *m"
.Fa "BN_CTX *ctx"
.Fc
.Sh DESCRIPTION
.Fn BN_mod_inverse
computes the inverse of
.Fa a
modulo
.Fa n
.Fa m
and places the result in
.Fa r ,
so
.Fa r
.Pq Li (a*r)%n==1 .
is such that
.Li a * r == 1 (mod m) .
If
.Fa r
is
.Dv NULL ,
a new
.Vt BIGNUM
is created.
is allocated.
.Pp
If the flag
.Dv BN_FLG_CONSTTIME
is set on
.Fa a
or
.Fa n ,
.Fa m ,
it operates in constant time.
.Pp
.Fa ctx
Expand All @@ -98,7 +101,7 @@ may be the same
as
.Fa a
or
.Fa n .
.Fa m .
.Sh RETURN VALUES
.Fn BN_mod_inverse
returns the
Expand Down

0 comments on commit 09d458b

Please sign in to comment.