From 09d458bcdb0fd5d4f00515835e7470d31714c3d9 Mon Sep 17 00:00:00 2001 From: tb Date: Thu, 19 Oct 2023 19:17:46 +0000 Subject: [PATCH] Rename the modulus from n into m This matches what other pages use. Also rewrite the definition of the modular inverse to be less ugly. --- lib/libcrypto/man/BN_mod_inverse.3 | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/libcrypto/man/BN_mod_inverse.3 b/lib/libcrypto/man/BN_mod_inverse.3 index 788f66fb931..f76191bd6ac 100644 --- a/lib/libcrypto/man/BN_mod_inverse.3 +++ b/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 . @@ -48,19 +48,19 @@ .\" 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 @@ -68,24 +68,27 @@ 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 @@ -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 -- 2.20.1