summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2023-04-21 06:34:37 +0000
committertb <>2023-04-21 06:34:37 +0000
commit800bdf8c9aa4299de4237c15d63e4a201a02c594 (patch)
tree7c4635add07c020ad9c526cbcb7c3e9b7b45c809 /src
parent7d7880d739fd6c735afacc51d000ad5b55ffab06 (diff)
downloadopenbsd-800bdf8c9aa4299de4237c15d63e4a201a02c594.tar.gz
openbsd-800bdf8c9aa4299de4237c15d63e4a201a02c594.tar.bz2
openbsd-800bdf8c9aa4299de4237c15d63e4a201a02c594.zip
Remove some (soon to be) outdated documentation
The documentation of the BN_MOD_CTX has been out of sync with reality for decades. The structure is now opaque, so its members should not be documented this way. They internals aren't important for the rest of the page. BN_MOD_CTX_init() will soon be removed. It's useless unless you like leaks.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/BN_mod_mul_montgomery.351
1 files changed, 3 insertions, 48 deletions
diff --git a/src/lib/libcrypto/man/BN_mod_mul_montgomery.3 b/src/lib/libcrypto/man/BN_mod_mul_montgomery.3
index 7b22efd7f5..0815eced49 100644
--- a/src/lib/libcrypto/man/BN_mod_mul_montgomery.3
+++ b/src/lib/libcrypto/man/BN_mod_mul_montgomery.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: BN_mod_mul_montgomery.3,v 1.14 2021/12/21 11:14:07 schwarze Exp $ 1.\" $OpenBSD: BN_mod_mul_montgomery.3,v 1.15 2023/04/21 06:34:37 tb Exp $
2.\" full merge up to: OpenSSL 6859cf74 Sep 25 13:33:28 2002 +0000 2.\" full merge up to: OpenSSL 6859cf74 Sep 25 13:33:28 2002 +0000
3.\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100 3.\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100
4.\" 4.\"
@@ -66,12 +66,11 @@
66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
67.\" OF THE POSSIBILITY OF SUCH DAMAGE. 67.\" OF THE POSSIBILITY OF SUCH DAMAGE.
68.\" 68.\"
69.Dd $Mdocdate: December 21 2021 $ 69.Dd $Mdocdate: April 21 2023 $
70.Dt BN_MOD_MUL_MONTGOMERY 3 70.Dt BN_MOD_MUL_MONTGOMERY 3
71.Os 71.Os
72.Sh NAME 72.Sh NAME
73.Nm BN_MONT_CTX_new , 73.Nm BN_MONT_CTX_new ,
74.Nm BN_MONT_CTX_init ,
75.Nm BN_MONT_CTX_free , 74.Nm BN_MONT_CTX_free ,
76.Nm BN_MONT_CTX_set , 75.Nm BN_MONT_CTX_set ,
77.Nm BN_MONT_CTX_set_locked , 76.Nm BN_MONT_CTX_set_locked ,
@@ -87,10 +86,6 @@
87.Fa void 86.Fa void
88.Fc 87.Fc
89.Ft void 88.Ft void
90.Fo BN_MONT_CTX_init
91.Fa "BN_MONT_CTX *ctx"
92.Fc
93.Ft void
94.Fo BN_MONT_CTX_free 89.Fo BN_MONT_CTX_free
95.Fa "BN_MONT_CTX *mont" 90.Fa "BN_MONT_CTX *mont"
96.Fc 91.Fc
@@ -146,12 +141,6 @@ allocates and initializes a
146.Vt BN_MONT_CTX 141.Vt BN_MONT_CTX
147structure. 142structure.
148.Pp 143.Pp
149.Fn BN_MONT_CTX_init
150initializes an existing uninitialized
151.Vt BN_MONT_CTX .
152It is deprecated and dangerous: see
153.Sx CAVEATS .
154.Pp
155.Fn BN_MONT_CTX_set 144.Fn BN_MONT_CTX_set
156sets up the 145sets up the
157.Fa mont 146.Fa mont
@@ -237,21 +226,6 @@ is a previously allocated
237.Vt BN_CTX 226.Vt BN_CTX
238used for temporary variables. 227used for temporary variables.
239.Pp 228.Pp
240The
241.Vt BN_MONT_CTX
242structure is defined as follows:
243.Bd -literal
244typedef struct bn_mont_ctx_st {
245 int ri; /* number of bits in R */
246 BIGNUM RR; /* R^2 (used to convert to Montgomery form) */
247 BIGNUM N; /* The modulus */
248 BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1
249 * (Ni is only stored for bignum algorithm) */
250 BN_ULONG n0; /* least significant word of Ni */
251 int flags;
252} BN_MONT_CTX;
253.Ed
254.Pp
255.Sy Warning : 229.Sy Warning :
256The inputs must be reduced modulo 230The inputs must be reduced modulo
257.Fa m , 231.Fa m ,
@@ -288,29 +262,10 @@ and
288first appeared in SSLeay 0.6.1 and have been available since 262first appeared in SSLeay 0.6.1 and have been available since
289.Ox 2.4 . 263.Ox 2.4 .
290.Pp 264.Pp
291.Fn BN_MONT_CTX_init
292and
293.Fn BN_MONT_CTX_copy 265.Fn BN_MONT_CTX_copy
294first appeared in SSLeay 0.9.1 and have been available since 266first appeared in SSLeay 0.9.1 and has been available since
295.Ox 2.6 . 267.Ox 2.6 .
296.Pp 268.Pp
297.Fn BN_MONT_CTX_set_locked 269.Fn BN_MONT_CTX_set_locked
298first appeared in OpenSSL 0.9.8 and has been available since 270first appeared in OpenSSL 0.9.8 and has been available since
299.Ox 4.0 . 271.Ox 4.0 .
300.Sh CAVEATS
301.Fn BN_MONT_CTX_init
302must not be called on a context that was used previously, or
303memory used by the embedded
304.Vt BIGNUM
305structures is leaked immediately.
306Besides, it must not be called on a context created with
307.Fn BN_MONT_CTX_new ,
308or the context itself will likely be leaked later.
309It can only be used on a static
310.Vt BN_MONT_CTX
311structure, on one located on the stack, or on one
312.Xr malloc 3 Ap ed
313manually, but all these options are discouraged because they
314will no longer work once
315.Vt BN_MONT_CTX
316is made opaque.