summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2023-11-16 18:10:19 +0000
committerschwarze <>2023-11-16 18:10:19 +0000
commit273b50890c3a58ac9b6ef65f2b50c5674e137062 (patch)
tree0f2405b2aa1f8a29ebbe327d97336960ba90b789 /src
parentc43cf927f2fc7cbcd6e8e3487114ab8fa80c57c3 (diff)
downloadopenbsd-273b50890c3a58ac9b6ef65f2b50c5674e137062.tar.gz
openbsd-273b50890c3a58ac9b6ef65f2b50c5674e137062.tar.bz2
openbsd-273b50890c3a58ac9b6ef65f2b50c5674e137062.zip
delete lots of stuff that no longer exists
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/bn_dump.3317
1 files changed, 17 insertions, 300 deletions
diff --git a/src/lib/libcrypto/man/bn_dump.3 b/src/lib/libcrypto/man/bn_dump.3
index cfe707b775..b4272441e5 100644
--- a/src/lib/libcrypto/man/bn_dump.3
+++ b/src/lib/libcrypto/man/bn_dump.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: bn_dump.3,v 1.8 2023/01/20 12:16:46 jsing Exp $ 1.\" $OpenBSD: bn_dump.3,v 1.9 2023/11/16 18:10:19 schwarze Exp $
2.\" full merge up to: 2.\" full merge up to:
3.\" OpenSSL crypto/bn/README.pod aebb9aac Jul 19 09:27:53 2016 -0400 3.\" OpenSSL crypto/bn/README.pod aebb9aac Jul 19 09:27:53 2016 -0400
4.\" 4.\"
@@ -50,7 +50,7 @@
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE. 51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\" 52.\"
53.Dd $Mdocdate: January 20 2023 $ 53.Dd $Mdocdate: November 16 2023 $
54.Dt BN_DUMP 3 54.Dt BN_DUMP 3
55.Os 55.Os
56.Sh NAME 56.Sh NAME
@@ -64,28 +64,12 @@
64.Nm bn_mul_comba8 , 64.Nm bn_mul_comba8 ,
65.Nm bn_sqr_comba4 , 65.Nm bn_sqr_comba4 ,
66.Nm bn_sqr_comba8 , 66.Nm bn_sqr_comba8 ,
67.Nm bn_cmp_words ,
68.Nm bn_mul_normal , 67.Nm bn_mul_normal ,
69.Nm bn_mul_recursive ,
70.Nm bn_mul_part_recursive ,
71.Nm bn_sqr_normal ,
72.Nm bn_sqr_recursive ,
73.Nm bn_expand , 68.Nm bn_expand ,
74.Nm bn_wexpand , 69.Nm bn_wexpand
75.Nm bn_expand2 ,
76.Nm bn_fix_top ,
77.Nm bn_check_top ,
78.Nm bn_print ,
79.Nm bn_dump ,
80.Nm bn_set_max ,
81.Nm bn_set_high ,
82.Nm bn_set_low ,
83.Nm mul ,
84.Nm mul_add ,
85.Nm sqr
86.Nd BIGNUM library internal functions 70.Nd BIGNUM library internal functions
87.Sh SYNOPSIS 71.Sh SYNOPSIS
88.In openssl/bn.h 72.Fd #include "bn_local.h"
89.Ft BN_ULONG 73.Ft BN_ULONG
90.Fo bn_mul_words 74.Fo bn_mul_words
91.Fa "BN_ULONG *rp" 75.Fa "BN_ULONG *rp"
@@ -148,12 +132,6 @@
148.Fa "BN_ULONG *r" 132.Fa "BN_ULONG *r"
149.Fa "BN_ULONG *a" 133.Fa "BN_ULONG *a"
150.Fc 134.Fc
151.Ft int
152.Fo bn_cmp_words
153.Fa "BN_ULONG *a"
154.Fa "BN_ULONG *b"
155.Fa "int n"
156.Fc
157.Ft void 135.Ft void
158.Fo bn_mul_normal 136.Fo bn_mul_normal
159.Fa "BN_ULONG *r" 137.Fa "BN_ULONG *r"
@@ -162,60 +140,6 @@
162.Fa "BN_ULONG *b" 140.Fa "BN_ULONG *b"
163.Fa "int nb" 141.Fa "int nb"
164.Fc 142.Fc
165.Ft void
166.Fo bn_mul_recursive
167.Fa "BN_ULONG *r"
168.Fa "BN_ULONG *a"
169.Fa "BN_ULONG *b"
170.Fa "int n2"
171.Fa "int dna"
172.Fa "int dnb"
173.Fa "BN_ULONG *tmp"
174.Fc
175.Ft void
176.Fo bn_mul_part_recursive
177.Fa "BN_ULONG *r"
178.Fa "BN_ULONG *a"
179.Fa "BN_ULONG *b"
180.Fa "int n"
181.Fa "int tna"
182.Fa "int tnb"
183.Fa "BN_ULONG *tmp"
184.Fc
185.Ft void
186.Fo bn_sqr_normal
187.Fa "BN_ULONG *r"
188.Fa "BN_ULONG *a"
189.Fa "int n"
190.Fa "BN_ULONG *tmp"
191.Fc
192.Ft void
193.Fo bn_sqr_recursive
194.Fa "BN_ULONG *r"
195.Fa "BN_ULONG *a"
196.Fa "int n2"
197.Fa "BN_ULONG *tmp"
198.Fc
199.Ft void
200.Fo mul
201.Fa "BN_ULONG r"
202.Fa "BN_ULONG a"
203.Fa "BN_ULONG w"
204.Fa "BN_ULONG c"
205.Fc
206.Ft void
207.Fo mul_add
208.Fa "BN_ULONG r"
209.Fa "BN_ULONG a"
210.Fa "BN_ULONG w"
211.Fa "BN_ULONG c"
212.Fc
213.Ft void
214.Fo sqr
215.Fa "BN_ULONG r0"
216.Fa "BN_ULONG r1"
217.Fa "BN_ULONG a"
218.Fc
219.Ft BIGNUM * 143.Ft BIGNUM *
220.Fo bn_expand 144.Fo bn_expand
221.Fa "BIGNUM *a" 145.Fa "BIGNUM *a"
@@ -226,46 +150,8 @@
226.Fa "BIGNUM *a" 150.Fa "BIGNUM *a"
227.Fa "int n" 151.Fa "int n"
228.Fc 152.Fc
229.Ft BIGNUM *
230.Fo bn_expand2
231.Fa "BIGNUM *a"
232.Fa "int n"
233.Fc
234.Ft void
235.Fo bn_fix_top
236.Fa "BIGNUM *a"
237.Fc
238.Ft void
239.Fo bn_check_top
240.Fa "BIGNUM *a"
241.Fc
242.Ft void
243.Fo bn_print
244.Fa "BIGNUM *a"
245.Fc
246.Ft void
247.Fo bn_dump
248.Fa "BN_ULONG *d"
249.Fa "int n"
250.Fc
251.Ft void
252.Fo bn_set_max
253.Fa "BIGNUM *a"
254.Fc
255.Ft void
256.Fo bn_set_high
257.Fa "BIGNUM *r"
258.Fa "BIGNUM *a"
259.Fa "int n"
260.Fc
261.Ft void
262.Fo bn_set_low
263.Fa "BIGNUM *r"
264.Fa "BIGNUM *a"
265.Fa "int n"
266.Fc
267.Sh DESCRIPTION 153.Sh DESCRIPTION
268This page documents the internal functions used by the OpenSSL 154This page documents some internal functions used by the
269.Vt BIGNUM 155.Vt BIGNUM
270implementation. 156implementation.
271They are described here to facilitate debugging and extending the 157They are described here to facilitate debugging and extending the
@@ -327,16 +213,12 @@ is a bit field of flags which are defined in
327.In openssl/bn.h . 213.In openssl/bn.h .
328The flags begin with 214The flags begin with
329.Dv BN_FLG_ . 215.Dv BN_FLG_ .
330The macros 216The functions
331.Fn BN_set_flags b n 217.Xr BN_set_flags 3
332and 218and
333.Fn BN_get_flags b n 219.Xr BN_get_flags 3
334exist to enable or fetch flag(s) 220enable or inspect
335.Fa n 221.Fa flags .
336from a
337.Vt BIGNUM
338structure
339.Fa b .
340.Pp 222.Pp
341Various routines in this library require the use of temporary 223Various routines in this library require the use of temporary
342.Vt BIGNUM 224.Vt BIGNUM
@@ -488,18 +370,6 @@ and the 16 word array
488.Pp 370.Pp
489The following functions are implemented in C: 371The following functions are implemented in C:
490.Pp 372.Pp
491.Fn bn_cmp_words a b n
492operates on the
493.Fa n
494word arrays
495.Fa a
496and
497.Fa b .
498It returns 1, 0 and -1 if
499.Fa a
500is greater than, equal and less than
501.Fa b .
502.Pp
503.Fn bn_mul_normal r a na b nb 373.Fn bn_mul_normal r a na b nb
504operates on the 374operates on the
505.Fa na 375.Fa na
@@ -518,103 +388,15 @@ It computes
518and places the result in 388and places the result in
519.Fa r . 389.Fa r .
520.Pp 390.Pp
521.Fn bn_mul_recursive r a b n2 dna dnb t
522operates on the word arrays
523.Fa a
524and
525.Fa b
526of length
527.Fa n2 Ns + Ns Fa dna
528and
529.Fa n2 Ns + Ns Fa dnb
530.Pf ( Fa dna
531and
532.Fa dnb
533are currently allowed to be 0 or negative) and the
534.Pf 2* Fa n2
535word arrays
536.Fa r
537and
538.Sy t .
539.Fa n2
540must be a power of 2.
541It computes
542.Fa a Ns * Ns Fa b
543and places the result in
544.Fa r .
545.Pp
546.Fn bn_mul_part_recursive r a b n tna tnb tmp
547operates on the word arrays
548.Fa a
549and
550.Fa b
551of length
552.Fa n Ns + Ns Fa tna
553and
554.Fa n Ns + Ns Fa tnb
555and the
556.Pf 4* Fa n
557word arrays
558.Fa r
559and
560.Fa tmp .
561.Pp
562.Xr BN_mul 3 391.Xr BN_mul 3
563calls 392calls
564.Fn bn_mul_normal , 393.Fn bn_mul_comba4
565or an optimized implementation if the factors have the same size: 394if both factors are 4 words long,
566.Fn bn_mul_comba8 395.Fn bn_mul_comba8
567is used if they are 8 words long, 396if both factors are 8 words long,
568.Fn bn_mul_recursive 397or
569if they are larger than 398.Fn bn_mul_normal
570.Dv BN_MULL_SIZE_NORMAL 399otherwise.
571and the size is an exact multiple of the word size, and
572.Fn bn_mul_part_recursive
573for others that are larger than
574.Dv BN_MULL_SIZE_NORMAL .
575.Pp
576.Fn bn_sqr_normal r a n tmp
577operates on the
578.Fa n
579word array
580.Fa a
581and the
582.Pf 2* Fa n
583word arrays
584.Fa tmp
585and
586.Fa r .
587.Pp
588The implementations use the following macros which, depending on the
589architecture, may use
590.Vt long long
591C operations or inline assembler.
592They are defined in
593.Pa bn_lcl.h .
594.Pp
595.Fn mul r a w c
596computes
597.Fa w Ns * Ns Fa a Ns + Ns Fa c
598and places the low word of the result in
599.Fa r
600and the high word in
601.Fa c .
602.Pp
603.Fn mul_add r a w c
604computes
605.Fa w Ns * Ns Fa a Ns + Ns Fa r Ns + Ns Fa c
606and places the low word of the result in
607.Fa r
608and the high word in
609.Fa c .
610.Pp
611.Fn sqr r0 r1 a
612computes
613.Fa a Ns * Ns Fa a
614and places the low word of the result in
615.Fa r0
616and the high word in
617.Fa r1 .
618.Ss Size changes 400.Ss Size changes
619.Fn bn_expand 401.Fn bn_expand
620ensures that 402ensures that
@@ -628,71 +410,6 @@ ensures that
628has enough space for an 410has enough space for an
629.Fa n 411.Fa n
630word number. 412word number.
631If the number has to be expanded, both macros call 413They return 0 on error or 1 otherwise.
632.Fn bn_expand2 ,
633which allocates a new
634.Fa d
635array and copies the data.
636They return
637.Dv NULL
638on error,
639.Fa b
640otherwise.
641.Pp
642The
643.Fn bn_fix_top
644macro reduces
645.Fa a Ns -> Ns Fa top
646to point to the most significant non-zero word plus one when
647.Fa a
648has shrunk.
649.Ss Debugging
650.Fn bn_check_top
651verifies that
652.Ql ((a)-\(ratop \(ra= 0 && (a)-\(ratop \(la= (a)-\(radmax) .
653A violation will cause the program to abort.
654.Pp
655.Fn bn_print
656prints
657.Fa a
658to
659.Dv stderr .
660.Fn bn_dump
661prints
662.Fa n
663words at
664.Fa d
665(in reverse order, i.e.\&
666most significant word first) to
667.Dv stderr .
668.Pp
669.Fn bn_set_max
670makes
671.Fa a
672a static number with a
673.Fa dmax
674of its current size.
675This is used by
676.Fn bn_set_low
677and
678.Fn bn_set_high
679to make
680.Fa r
681a read-only
682.Vt BIGNUM
683that contains the
684.Fa n
685low or high words of
686.Fa a .
687.Pp
688If
689.Dv BN_DEBUG
690is not defined,
691.Fn bn_check_top ,
692.Fn bn_print ,
693.Fn bn_dump
694and
695.Fn bn_set_max
696are defined as empty macros.
697.Sh SEE ALSO 414.Sh SEE ALSO
698.Xr BN_new 3 415.Xr BN_new 3