summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2021-12-19 18:39:32 +0000
committerschwarze <>2021-12-19 18:39:32 +0000
commit1d2f595156001c309492b0d34aa50576351b7ed8 (patch)
tree189618dd717d3800917a8159ace8f19f28f0edd7
parent289a7e9ab1fcdb90063348d01f3b19009239985d (diff)
downloadopenbsd-1d2f595156001c309492b0d34aa50576351b7ed8.tar.gz
openbsd-1d2f595156001c309492b0d34aa50576351b7ed8.tar.bz2
openbsd-1d2f595156001c309492b0d34aa50576351b7ed8.zip
document BN_uadd(3) and BN_usub(3)
-rw-r--r--src/lib/libcrypto/man/BN_add.385
1 files changed, 78 insertions, 7 deletions
diff --git a/src/lib/libcrypto/man/BN_add.3 b/src/lib/libcrypto/man/BN_add.3
index 355d7a7cb3..e2f1642aa7 100644
--- a/src/lib/libcrypto/man/BN_add.3
+++ b/src/lib/libcrypto/man/BN_add.3
@@ -1,9 +1,26 @@
1.\" $OpenBSD: BN_add.3,v 1.14 2021/11/30 18:34:35 tb Exp $ 1.\" $OpenBSD: BN_add.3,v 1.15 2021/12/19 18:39:32 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 2.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100
3.\" 3.\"
4.\" This file was written by Ulf Moeller <ulf@openssl.org> 4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
8.\"
9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above
11.\" copyright notice and this permission notice appear in all copies.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\"
21.\" The original file was written by Ulf Moeller <ulf@openssl.org>
5.\" and Bodo Moeller <bodo@openssl.org>. 22.\" and Bodo Moeller <bodo@openssl.org>.
6.\" Copyright (c) 2000, 2001, 2015 The OpenSSL Project. All rights reserved. 23.\" Copyright (c) 2000, 2015 The OpenSSL Project. All rights reserved.
7.\" 24.\"
8.\" Redistribution and use in source and binary forms, with or without 25.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions 26.\" modification, are permitted provided that the following conditions
@@ -49,12 +66,14 @@
49.\" 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
50.\" OF THE POSSIBILITY OF SUCH DAMAGE. 67.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\" 68.\"
52.Dd $Mdocdate: November 30 2021 $ 69.Dd $Mdocdate: December 19 2021 $
53.Dt BN_ADD 3 70.Dt BN_ADD 3
54.Os 71.Os
55.Sh NAME 72.Sh NAME
56.Nm BN_add , 73.Nm BN_add ,
74.Nm BN_uadd ,
57.Nm BN_sub , 75.Nm BN_sub ,
76.Nm BN_usub ,
58.Nm BN_mul , 77.Nm BN_mul ,
59.Nm BN_sqr , 78.Nm BN_sqr ,
60.Nm BN_div , 79.Nm BN_div ,
@@ -84,12 +103,24 @@
84.Fa "const BIGNUM *b" 103.Fa "const BIGNUM *b"
85.Fc 104.Fc
86.Ft int 105.Ft int
106.Fo BN_uadd
107.Fa "BIGNUM *r"
108.Fa "const BIGNUM *a"
109.Fa "const BIGNUM *b"
110.Fc
111.Ft int
87.Fo BN_sub 112.Fo BN_sub
88.Fa "BIGNUM *r" 113.Fa "BIGNUM *r"
89.Fa "const BIGNUM *a" 114.Fa "const BIGNUM *a"
90.Fa "const BIGNUM *b" 115.Fa "const BIGNUM *b"
91.Fc 116.Fc
92.Ft int 117.Ft int
118.Fo BN_usub
119.Fa "BIGNUM *r"
120.Fa "const BIGNUM *a"
121.Fa "const BIGNUM *b"
122.Fc
123.Ft int
93.Fo BN_mul 124.Fo BN_mul
94.Fa "BIGNUM *r" 125.Fa "BIGNUM *r"
95.Fa "const BIGNUM *a" 126.Fa "const BIGNUM *a"
@@ -194,6 +225,22 @@ as
194or 225or
195.Fa b . 226.Fa b .
196.Pp 227.Pp
228.Fn BN_uadd
229adds the absolute values of
230.Fa a
231and
232.Fa b
233and places the result in
234.Fa r
235.Pq Li r=|a|+|b|\& .
236.Fa r
237may be the same
238.Vt BIGNUM
239as
240.Fa a
241or
242.Fa b .
243.Pp
197.Fn BN_sub 244.Fn BN_sub
198subtracts 245subtracts
199.Fa b 246.Fa b
@@ -210,6 +257,28 @@ as
210or 257or
211.Fa b . 258.Fa b .
212.Pp 259.Pp
260.Fn BN_usub
261subtracts the absolute value of
262.Fa b
263from the absolute value of
264.Fa a
265and places the result in
266.Fa r
267.Pq Li r=|a|-|b|\& .
268It requires the absolute value of
269.Fa a
270to be greater than the absolute value of
271.Fa b ;
272otherwise, it will sometimes fail
273and sometimes silently produce wrong results.
274.Fa r
275may be the same
276.Vt BIGNUM
277as
278.Fa a
279or
280.Fa b .
281.Pp
213.Fn BN_mul 282.Fn BN_mul
214multiplies 283multiplies
215.Fa a 284.Fa a
@@ -422,11 +491,13 @@ first appeared in SSLeay 0.9.0.
422All these functions have been available since 491All these functions have been available since
423.Ox 2.4 . 492.Ox 2.4 .
424.Pp 493.Pp
425The 494.Fn BN_uadd ,
495.Fn BN_usub ,
496and the
426.Fa ctx 497.Fa ctx
427argument to 498argument to
428.Fn BN_mul 499.Fn BN_mul
429was added in SSLeay 0.9.1 and 500first appeared in SSLeay 0.9.1 and have been available since
430.Ox 2.6 . 501.Ox 2.6 .
431.Pp 502.Pp
432.Fn BN_nnmod , 503.Fn BN_nnmod ,