summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2021-12-20 15:02:13 +0000
committerschwarze <>2021-12-20 15:02:13 +0000
commita08f6ce5af8031450a431ef3ebfc98d6ff21ae60 (patch)
treedf999b59360d7b816c57d645d85778fc3e53abad
parent441c99b87b2c1b279a582436aafe0a064d1bc709 (diff)
downloadopenbsd-a08f6ce5af8031450a431ef3ebfc98d6ff21ae60.tar.gz
openbsd-a08f6ce5af8031450a431ef3ebfc98d6ff21ae60.tar.bz2
openbsd-a08f6ce5af8031450a431ef3ebfc98d6ff21ae60.zip
document BN_mod_add_quick(3), BN_mod_sub_quick(3), BN_mod_lshift(3),
BN_mod_lshift_quick(3), BN_mod_lshift1(3), and BN_mod_lshift1_quick(3)
-rw-r--r--src/lib/libcrypto/man/BN_add.3118
1 files changed, 115 insertions, 3 deletions
diff --git a/src/lib/libcrypto/man/BN_add.3 b/src/lib/libcrypto/man/BN_add.3
index e2f1642aa7..ab2d343321 100644
--- a/src/lib/libcrypto/man/BN_add.3
+++ b/src/lib/libcrypto/man/BN_add.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: BN_add.3,v 1.15 2021/12/19 18:39:32 schwarze Exp $ 1.\" $OpenBSD: BN_add.3,v 1.16 2021/12/20 15:02:13 schwarze Exp $
2.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 2.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100
3.\" 3.\"
4.\" This file is a derived work. 4.\" This file is a derived work.
@@ -66,7 +66,7 @@
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 19 2021 $ 69.Dd $Mdocdate: December 20 2021 $
70.Dt BN_ADD 3 70.Dt BN_ADD 3
71.Os 71.Os
72.Sh NAME 72.Sh NAME
@@ -80,9 +80,15 @@
80.Nm BN_mod , 80.Nm BN_mod ,
81.Nm BN_nnmod , 81.Nm BN_nnmod ,
82.Nm BN_mod_add , 82.Nm BN_mod_add ,
83.Nm BN_mod_add_quick ,
83.Nm BN_mod_sub , 84.Nm BN_mod_sub ,
85.Nm BN_mod_sub_quick ,
84.Nm BN_mod_mul , 86.Nm BN_mod_mul ,
85.Nm BN_mod_sqr , 87.Nm BN_mod_sqr ,
88.Nm BN_mod_lshift ,
89.Nm BN_mod_lshift_quick ,
90.Nm BN_mod_lshift1 ,
91.Nm BN_mod_lshift1_quick ,
86.Nm BN_exp , 92.Nm BN_exp ,
87.Nm BN_mod_exp , 93.Nm BN_mod_exp ,
88.\" The following are public, but intentionally undocumented for now: 94.\" The following are public, but intentionally undocumented for now:
@@ -164,6 +170,13 @@
164.Fa "BN_CTX *ctx" 170.Fa "BN_CTX *ctx"
165.Fc 171.Fc
166.Ft int 172.Ft int
173.Fo BN_mod_add_quick
174.Fa "BIGNUM *r"
175.Fa "const BIGNUM *a"
176.Fa "const BIGNUM *b"
177.Fa "const BIGNUM *m"
178.Fc
179.Ft int
167.Fo BN_mod_sub 180.Fo BN_mod_sub
168.Fa "BIGNUM *r" 181.Fa "BIGNUM *r"
169.Fa "const BIGNUM *a" 182.Fa "const BIGNUM *a"
@@ -172,6 +185,13 @@
172.Fa "BN_CTX *ctx" 185.Fa "BN_CTX *ctx"
173.Fc 186.Fc
174.Ft int 187.Ft int
188.Fo BN_mod_sub_quick
189.Fa "BIGNUM *r"
190.Fa "const BIGNUM *a"
191.Fa "const BIGNUM *b"
192.Fa "const BIGNUM *m"
193.Fc
194.Ft int
175.Fo BN_mod_mul 195.Fo BN_mod_mul
176.Fa "BIGNUM *r" 196.Fa "BIGNUM *r"
177.Fa "const BIGNUM *a" 197.Fa "const BIGNUM *a"
@@ -187,6 +207,34 @@
187.Fa "BN_CTX *ctx" 207.Fa "BN_CTX *ctx"
188.Fc 208.Fc
189.Ft int 209.Ft int
210.Fo BN_mod_lshift
211.Fa "BIGNUM *r"
212.Fa "const BIGNUM *a"
213.Fa "int n"
214.Fa "const BIGNUM *m"
215.Fa "BN_CTX *ctx"
216.Fc
217.Ft int
218.Fo BN_mod_lshift_quick
219.Fa "BIGNUM *r"
220.Fa "const BIGNUM *a"
221.Fa "int n"
222.Fa "const BIGNUM *m"
223.Fc
224.Ft int
225.Fo BN_mod_lshift1
226.Fa "BIGNUM *r"
227.Fa "const BIGNUM *a"
228.Fa "const BIGNUM *m"
229.Fa "BN_CTX *ctx"
230.Fc
231.Ft int
232.Fo BN_mod_lshift1_quick
233.Fa "BIGNUM *r"
234.Fa "const BIGNUM *a"
235.Fa "const BIGNUM *m"
236.Fc
237.Ft int
190.Fo BN_exp 238.Fo BN_exp
191.Fa "BIGNUM *r" 239.Fa "BIGNUM *r"
192.Fa "const BIGNUM *a" 240.Fa "const BIGNUM *a"
@@ -368,6 +416,18 @@ modulo
368and places the non-negative result in 416and places the non-negative result in
369.Fa r . 417.Fa r .
370.Pp 418.Pp
419.Fn BN_mod_add_quick
420is a variant of
421.Fn BN_mod_add
422that requires
423.Fa a
424and
425.Fa b
426to both be non-negative and smaller than
427.Fa m .
428If any of these constraints are violated,
429it silently produces wrong results.
430.Pp
371.Fn BN_mod_sub 431.Fn BN_mod_sub
372subtracts 432subtracts
373.Fa b 433.Fa b
@@ -378,6 +438,18 @@ modulo
378and places the non-negative result in 438and places the non-negative result in
379.Fa r . 439.Fa r .
380.Pp 440.Pp
441.Fn BN_mod_sub_quick
442is a variant of
443.Fn BN_mod_sub
444that requires
445.Fa a
446and
447.Fa b
448to both be non-negative and smaller than
449.Fa m .
450If any of these constraints are violated,
451it silently produces wrong results.
452.Pp
381.Fn BN_mod_mul 453.Fn BN_mod_mul
382multiplies 454multiplies
383.Fa a 455.Fa a
@@ -407,6 +479,40 @@ modulo
407and places the result in 479and places the result in
408.Fa r . 480.Fa r .
409.Pp 481.Pp
482.Fn BN_mod_lshift
483shifts
484.Fa a
485left by
486.Fa n
487bits, reduces the result modulo
488.Fa m ,
489and places the non-negative remainder in
490.Fa r
491.Pq Li r=a*2^n mod m .
492.Pp
493.Fn BN_mod_lshift1
494shifts
495.Fa a
496left by one bit, reduces the result modulo
497.Fa m ,
498and places the non-negative remainder in
499.Fa r
500.Pq Li r=a*2 mod m .
501.Pp
502.Fn BN_mod_lshift_quick
503and
504.Fn BN_mod_lshift1_quick
505are variants of
506.Fn BN_mod_lshift
507and
508.Fn BN_mod_lshift1 ,
509respectively, that require
510.Fa a
511to be non-negative and less than
512.Fa m .
513If either of these constraints is violated, they sometimes fail
514and sometimes silently produce wrong results.
515.Pp
410.Fn BN_exp 516.Fn BN_exp
411raises 517raises
412.Fa a 518.Fa a
@@ -502,9 +608,15 @@ first appeared in SSLeay 0.9.1 and have been available since
502.Pp 608.Pp
503.Fn BN_nnmod , 609.Fn BN_nnmod ,
504.Fn BN_mod_add , 610.Fn BN_mod_add ,
611.Fn BN_mod_add_quick ,
505.Fn BN_mod_sub , 612.Fn BN_mod_sub ,
613.Fn BN_mod_sub_quick ,
614.Fn BN_mod_sqr ,
615.Fn BN_mod_lshift ,
616.Fn BN_mod_lshift_quick ,
617.Fn BN_mod_lshift1 ,
506and 618and
507.Fn BN_mod_sqr 619.Fn BN_mod_lshift1_quick
508first appeared in OpenSSL 0.9.7 and have been available since 620first appeared in OpenSSL 0.9.7 and have been available since
509.Ox 3.2 . 621.Ox 3.2 .
510.Sh BUGS 622.Sh BUGS