Deleted Added
full compact
bn_internal.3 (206048) bn_internal.3 (215698)
1.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.37
1.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07)
2.\"
3.\" Standard preamble:
4.\" ========================================================================
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
5.de Sp \" Vertical space (when we can't use .PP)
6.if t .sp .5v
7.if n .sp
8..
9.de Vb \" Begin verbatim text
10.ft CW
11.nf
12.ne \\$1
13..
14.de Ve \" End verbatim text
15.ft R
16.fi
17..
18.\" Set up some character translations and predefined strings. \*(-- will
19.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
20.\" double quote, and \*(R" will give a right double quote. \*(C+ will
21.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
22.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
23.\" nothing in troff, for use with C<>.
24.tr \(*W-
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
25.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26.ie n \{\
27. ds -- \(*W-
28. ds PI pi
29. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
31. ds L" ""
32. ds R" ""
33. ds C` ""
34. ds C' ""
35'br\}
36.el\{\
37. ds -- \|\(em\|
38. ds PI \(*p
39. ds L" ``
40. ds R" ''
41'br\}
42.\"
43.\" Escape single quotes in literal strings from groff's Unicode transform.
44.ie \n(.g .ds Aq \(aq
45.el .ds Aq '
46.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
47.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
48.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
49.\" entries marked with X<> in POD. Of course, you'll have to process the
50.\" output yourself in some meaningful fashion.
55.if \nF \{\
51.ie \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
52. de IX
53. tm Index:\\$1\t\\n%\t"\\$2"
54..
55. nr % 0
56. rr F
57.\}
58.el \{\
59. de IX
60..
61.\}
62.\"
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1

--- 48 unchanged lines hidden (view full) ---

124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "bn_internal 3"
63.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64.\" Fear. Run. Save yourself. No user-serviceable parts.
65. \" fudge factors for nroff and troff
66.if n \{\
67. ds #H 0
68. ds #V .8m
69. ds #F .3m
70. ds #[ \f1

--- 48 unchanged lines hidden (view full) ---

119. ds Th \o'LP'
120. ds ae ae
121. ds Ae AE
122.\}
123.rm #[ #] #H #V #F C
124.\" ========================================================================
125.\"
126.IX Title "bn_internal 3"
132.TH bn_internal 3 "2010-03-24" "0.9.8n" "OpenSSL"
127.TH bn_internal 3 "2010-11-16" "0.9.8p" "OpenSSL"
128.\" For nroff, turn off justification. Always turn off hyphenation; it makes
129.\" way too many mistakes in technical documents.
130.if n .ad l
131.nh
133.SH "NAME"
134bn_mul_words, bn_mul_add_words, bn_sqr_words, bn_div_words,
135bn_add_words, bn_sub_words, bn_mul_comba4, bn_mul_comba8,
136bn_sqr_comba4, bn_sqr_comba8, bn_cmp_words, bn_mul_normal,
137bn_mul_low_normal, bn_mul_recursive, bn_mul_part_recursive,
138bn_mul_low_recursive, bn_mul_high, bn_sqr_normal, bn_sqr_recursive,
139bn_expand, bn_wexpand, bn_expand2, bn_fix_top, bn_check_top,
140bn_print, bn_dump, bn_set_max, bn_set_high, bn_set_low \- BIGNUM
141library internal functions
142.SH "SYNOPSIS"
143.IX Header "SYNOPSIS"
132.SH "NAME"
133bn_mul_words, bn_mul_add_words, bn_sqr_words, bn_div_words,
134bn_add_words, bn_sub_words, bn_mul_comba4, bn_mul_comba8,
135bn_sqr_comba4, bn_sqr_comba8, bn_cmp_words, bn_mul_normal,
136bn_mul_low_normal, bn_mul_recursive, bn_mul_part_recursive,
137bn_mul_low_recursive, bn_mul_high, bn_sqr_normal, bn_sqr_recursive,
138bn_expand, bn_wexpand, bn_expand2, bn_fix_top, bn_check_top,
139bn_print, bn_dump, bn_set_max, bn_set_high, bn_set_low \- BIGNUM
140library internal functions
141.SH "SYNOPSIS"
142.IX Header "SYNOPSIS"
144.Vb 9
143.Vb 1
144\& #include <openssl/bn.h>
145\&
145\& BN_ULONG bn_mul_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w);
146\& BN_ULONG bn_mul_add_words(BN_ULONG *rp, BN_ULONG *ap, int num,
147\& BN_ULONG w);
148\& void bn_sqr_words(BN_ULONG *rp, BN_ULONG *ap, int num);
149\& BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d);
150\& BN_ULONG bn_add_words(BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp,
151\& int num);
152\& BN_ULONG bn_sub_words(BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp,
153\& int num);
146\& BN_ULONG bn_mul_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w);
147\& BN_ULONG bn_mul_add_words(BN_ULONG *rp, BN_ULONG *ap, int num,
148\& BN_ULONG w);
149\& void bn_sqr_words(BN_ULONG *rp, BN_ULONG *ap, int num);
150\& BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d);
151\& BN_ULONG bn_add_words(BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp,
152\& int num);
153\& BN_ULONG bn_sub_words(BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp,
154\& int num);
154.Ve
155.PP
156.Vb 4
155\&
157\& void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b);
158\& void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b);
159\& void bn_sqr_comba4(BN_ULONG *r, BN_ULONG *a);
160\& void bn_sqr_comba8(BN_ULONG *r, BN_ULONG *a);
156\& void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b);
157\& void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b);
158\& void bn_sqr_comba4(BN_ULONG *r, BN_ULONG *a);
159\& void bn_sqr_comba8(BN_ULONG *r, BN_ULONG *a);
161.Ve
162.PP
163.Vb 1
160\&
164\& int bn_cmp_words(BN_ULONG *a, BN_ULONG *b, int n);
161\& int bn_cmp_words(BN_ULONG *a, BN_ULONG *b, int n);
165.Ve
166.PP
167.Vb 11
162\&
168\& void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b,
169\& int nb);
170\& void bn_mul_low_normal(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n);
171\& void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
172\& int dna,int dnb,BN_ULONG *tmp);
173\& void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b,
174\& int n, int tna,int tnb, BN_ULONG *tmp);
175\& void bn_mul_low_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b,
176\& int n2, BN_ULONG *tmp);
177\& void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l,
178\& int n2, BN_ULONG *tmp);
163\& void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b,
164\& int nb);
165\& void bn_mul_low_normal(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n);
166\& void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2,
167\& int dna,int dnb,BN_ULONG *tmp);
168\& void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b,
169\& int n, int tna,int tnb, BN_ULONG *tmp);
170\& void bn_mul_low_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b,
171\& int n2, BN_ULONG *tmp);
172\& void bn_mul_high(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, BN_ULONG *l,
173\& int n2, BN_ULONG *tmp);
179.Ve
180.PP
181.Vb 2
174\&
182\& void bn_sqr_normal(BN_ULONG *r, BN_ULONG *a, int n, BN_ULONG *tmp);
183\& void bn_sqr_recursive(BN_ULONG *r, BN_ULONG *a, int n2, BN_ULONG *tmp);
175\& void bn_sqr_normal(BN_ULONG *r, BN_ULONG *a, int n, BN_ULONG *tmp);
176\& void bn_sqr_recursive(BN_ULONG *r, BN_ULONG *a, int n2, BN_ULONG *tmp);
184.Ve
185.PP
186.Vb 3
177\&
187\& void mul(BN_ULONG r, BN_ULONG a, BN_ULONG w, BN_ULONG c);
188\& void mul_add(BN_ULONG r, BN_ULONG a, BN_ULONG w, BN_ULONG c);
189\& void sqr(BN_ULONG r0, BN_ULONG r1, BN_ULONG a);
178\& void mul(BN_ULONG r, BN_ULONG a, BN_ULONG w, BN_ULONG c);
179\& void mul_add(BN_ULONG r, BN_ULONG a, BN_ULONG w, BN_ULONG c);
180\& void sqr(BN_ULONG r0, BN_ULONG r1, BN_ULONG a);
190.Ve
191.PP
192.Vb 4
181\&
193\& BIGNUM *bn_expand(BIGNUM *a, int bits);
194\& BIGNUM *bn_wexpand(BIGNUM *a, int n);
195\& BIGNUM *bn_expand2(BIGNUM *a, int n);
196\& void bn_fix_top(BIGNUM *a);
182\& BIGNUM *bn_expand(BIGNUM *a, int bits);
183\& BIGNUM *bn_wexpand(BIGNUM *a, int n);
184\& BIGNUM *bn_expand2(BIGNUM *a, int n);
185\& void bn_fix_top(BIGNUM *a);
197.Ve
198.PP
199.Vb 6
186\&
200\& void bn_check_top(BIGNUM *a);
201\& void bn_print(BIGNUM *a);
202\& void bn_dump(BN_ULONG *d, int n);
203\& void bn_set_max(BIGNUM *a);
204\& void bn_set_high(BIGNUM *r, BIGNUM *a, int n);
205\& void bn_set_low(BIGNUM *r, BIGNUM *a, int n);
206.Ve
207.SH "DESCRIPTION"
208.IX Header "DESCRIPTION"
209This page documents the internal functions used by the OpenSSL
210\&\fB\s-1BIGNUM\s0\fR implementation. They are described here to facilitate
211debugging and extending the library. They are \fInot\fR to be used by
212applications.
187\& void bn_check_top(BIGNUM *a);
188\& void bn_print(BIGNUM *a);
189\& void bn_dump(BN_ULONG *d, int n);
190\& void bn_set_max(BIGNUM *a);
191\& void bn_set_high(BIGNUM *r, BIGNUM *a, int n);
192\& void bn_set_low(BIGNUM *r, BIGNUM *a, int n);
193.Ve
194.SH "DESCRIPTION"
195.IX Header "DESCRIPTION"
196This page documents the internal functions used by the OpenSSL
197\&\fB\s-1BIGNUM\s0\fR implementation. They are described here to facilitate
198debugging and extending the library. They are \fInot\fR to be used by
199applications.
213.Sh "The \s-1BIGNUM\s0 structure"
200.SS "The \s-1BIGNUM\s0 structure"
214.IX Subsection "The BIGNUM structure"
215.Vb 1
216\& typedef struct bignum_st BIGNUM;
201.IX Subsection "The BIGNUM structure"
202.Vb 1
203\& typedef struct bignum_st BIGNUM;
217.Ve
218.PP
219.Vb 9
204\&
220\& struct bignum_st
221\& {
205\& struct bignum_st
206\& {
222\& BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */
207\& BN_ULONG *d; /* Pointer to an array of \*(AqBN_BITS2\*(Aq bit chunks. */
223\& int top; /* Index of last used d +1. */
224\& /* The next are internal book keeping for bn_expand. */
225\& int dmax; /* Size of the d array. */
226\& int neg; /* one if the number is negative */
227\& int flags;
228\& };
229.Ve
230.PP

--- 13 unchanged lines hidden (view full) ---

244structure \fBb\fR.
245.PP
246Various routines in this library require the use of temporary
247\&\fB\s-1BIGNUM\s0\fR variables during their execution. Since dynamic memory
248allocation to create \fB\s-1BIGNUM\s0\fRs is rather expensive when used in
249conjunction with repeated subroutine calls, the \fB\s-1BN_CTX\s0\fR structure is
250used. This structure contains \fB\s-1BN_CTX_NUM\s0\fR \fB\s-1BIGNUM\s0\fRs, see
251\&\fIBN_CTX_start\fR\|(3).
208\& int top; /* Index of last used d +1. */
209\& /* The next are internal book keeping for bn_expand. */
210\& int dmax; /* Size of the d array. */
211\& int neg; /* one if the number is negative */
212\& int flags;
213\& };
214.Ve
215.PP

--- 13 unchanged lines hidden (view full) ---

229structure \fBb\fR.
230.PP
231Various routines in this library require the use of temporary
232\&\fB\s-1BIGNUM\s0\fR variables during their execution. Since dynamic memory
233allocation to create \fB\s-1BIGNUM\s0\fRs is rather expensive when used in
234conjunction with repeated subroutine calls, the \fB\s-1BN_CTX\s0\fR structure is
235used. This structure contains \fB\s-1BN_CTX_NUM\s0\fR \fB\s-1BIGNUM\s0\fRs, see
236\&\fIBN_CTX_start\fR\|(3).
252.Sh "Low-level arithmetic operations"
237.SS "Low-level arithmetic operations"
253.IX Subsection "Low-level arithmetic operations"
254These functions are implemented in C and for several platforms in
255assembly language:
256.PP
257bn_mul_words(\fBrp\fR, \fBap\fR, \fBnum\fR, \fBw\fR) operates on the \fBnum\fR word
258arrays \fBrp\fR and \fBap\fR. It computes \fBap\fR * \fBw\fR, places the result
259in \fBrp\fR, and returns the high word (carry).
260.PP
261bn_mul_add_words(\fBrp\fR, \fBap\fR, \fBnum\fR, \fBw\fR) operates on the \fBnum\fR
262word arrays \fBrp\fR and \fBap\fR. It computes \fBap\fR * \fBw\fR + \fBrp\fR, places
263the result in \fBrp\fR, and returns the high word (carry).
264.PP
265bn_sqr_words(\fBrp\fR, \fBap\fR, \fBn\fR) operates on the \fBnum\fR word array
266\&\fBap\fR and the 2*\fBnum\fR word array \fBap\fR. It computes \fBap\fR * \fBap\fR
238.IX Subsection "Low-level arithmetic operations"
239These functions are implemented in C and for several platforms in
240assembly language:
241.PP
242bn_mul_words(\fBrp\fR, \fBap\fR, \fBnum\fR, \fBw\fR) operates on the \fBnum\fR word
243arrays \fBrp\fR and \fBap\fR. It computes \fBap\fR * \fBw\fR, places the result
244in \fBrp\fR, and returns the high word (carry).
245.PP
246bn_mul_add_words(\fBrp\fR, \fBap\fR, \fBnum\fR, \fBw\fR) operates on the \fBnum\fR
247word arrays \fBrp\fR and \fBap\fR. It computes \fBap\fR * \fBw\fR + \fBrp\fR, places
248the result in \fBrp\fR, and returns the high word (carry).
249.PP
250bn_sqr_words(\fBrp\fR, \fBap\fR, \fBn\fR) operates on the \fBnum\fR word array
251\&\fBap\fR and the 2*\fBnum\fR word array \fBap\fR. It computes \fBap\fR * \fBap\fR
267word\-wise, and places the low and high bytes of the result in \fBrp\fR.
252word-wise, and places the low and high bytes of the result in \fBrp\fR.
268.PP
269bn_div_words(\fBh\fR, \fBl\fR, \fBd\fR) divides the two word number (\fBh\fR,\fBl\fR)
270by \fBd\fR and returns the result.
271.PP
272bn_add_words(\fBrp\fR, \fBap\fR, \fBbp\fR, \fBnum\fR) operates on the \fBnum\fR word
273arrays \fBap\fR, \fBbp\fR and \fBrp\fR. It computes \fBap\fR + \fBbp\fR, places the
274result in \fBrp\fR, and returns the high word (carry).
275.PP

--- 65 unchanged lines hidden (view full) ---

341mul(\fBr\fR, \fBa\fR, \fBw\fR, \fBc\fR) computes \fBw\fR*\fBa\fR+\fBc\fR and places the
342low word of the result in \fBr\fR and the high word in \fBc\fR.
343.PP
344mul_add(\fBr\fR, \fBa\fR, \fBw\fR, \fBc\fR) computes \fBw\fR*\fBa\fR+\fBr\fR+\fBc\fR and
345places the low word of the result in \fBr\fR and the high word in \fBc\fR.
346.PP
347sqr(\fBr0\fR, \fBr1\fR, \fBa\fR) computes \fBa\fR*\fBa\fR and places the low word
348of the result in \fBr0\fR and the high word in \fBr1\fR.
253.PP
254bn_div_words(\fBh\fR, \fBl\fR, \fBd\fR) divides the two word number (\fBh\fR,\fBl\fR)
255by \fBd\fR and returns the result.
256.PP
257bn_add_words(\fBrp\fR, \fBap\fR, \fBbp\fR, \fBnum\fR) operates on the \fBnum\fR word
258arrays \fBap\fR, \fBbp\fR and \fBrp\fR. It computes \fBap\fR + \fBbp\fR, places the
259result in \fBrp\fR, and returns the high word (carry).
260.PP

--- 65 unchanged lines hidden (view full) ---

326mul(\fBr\fR, \fBa\fR, \fBw\fR, \fBc\fR) computes \fBw\fR*\fBa\fR+\fBc\fR and places the
327low word of the result in \fBr\fR and the high word in \fBc\fR.
328.PP
329mul_add(\fBr\fR, \fBa\fR, \fBw\fR, \fBc\fR) computes \fBw\fR*\fBa\fR+\fBr\fR+\fBc\fR and
330places the low word of the result in \fBr\fR and the high word in \fBc\fR.
331.PP
332sqr(\fBr0\fR, \fBr1\fR, \fBa\fR) computes \fBa\fR*\fBa\fR and places the low word
333of the result in \fBr0\fR and the high word in \fBr1\fR.
349.Sh "Size changes"
334.SS "Size changes"
350.IX Subsection "Size changes"
351\&\fIbn_expand()\fR ensures that \fBb\fR has enough space for a \fBbits\fR bit
352number. \fIbn_wexpand()\fR ensures that \fBb\fR has enough space for an
353\&\fBn\fR word number. If the number has to be expanded, both macros
354call \fIbn_expand2()\fR, which allocates a new \fBd\fR array and copies the
355data. They return \fB\s-1NULL\s0\fR on error, \fBb\fR otherwise.
356.PP
357The \fIbn_fix_top()\fR macro reduces \fBa\->top\fR to point to the most
358significant non-zero word plus one when \fBa\fR has shrunk.
335.IX Subsection "Size changes"
336\&\fIbn_expand()\fR ensures that \fBb\fR has enough space for a \fBbits\fR bit
337number. \fIbn_wexpand()\fR ensures that \fBb\fR has enough space for an
338\&\fBn\fR word number. If the number has to be expanded, both macros
339call \fIbn_expand2()\fR, which allocates a new \fBd\fR array and copies the
340data. They return \fB\s-1NULL\s0\fR on error, \fBb\fR otherwise.
341.PP
342The \fIbn_fix_top()\fR macro reduces \fBa\->top\fR to point to the most
343significant non-zero word plus one when \fBa\fR has shrunk.
359.Sh "Debugging"
344.SS "Debugging"
360.IX Subsection "Debugging"
361\&\fIbn_check_top()\fR verifies that \f(CW\*(C`((a)\->top >= 0 && (a)\->top
362<= (a)\->dmax)\*(C'\fR. A violation will cause the program to abort.
363.PP
364\&\fIbn_print()\fR prints \fBa\fR to stderr. \fIbn_dump()\fR prints \fBn\fR words at \fBd\fR
365(in reverse order, i.e. most significant word first) to stderr.
366.PP
367\&\fIbn_set_max()\fR makes \fBa\fR a static number with a \fBdmax\fR of its current size.
368This is used by \fIbn_set_low()\fR and \fIbn_set_high()\fR to make \fBr\fR a read-only
369\&\fB\s-1BIGNUM\s0\fR that contains the \fBn\fR low or high words of \fBa\fR.
370.PP
371If \fB\s-1BN_DEBUG\s0\fR is not defined, \fIbn_check_top()\fR, \fIbn_print()\fR, \fIbn_dump()\fR
372and \fIbn_set_max()\fR are defined as empty macros.
373.SH "SEE ALSO"
374.IX Header "SEE ALSO"
375\&\fIbn\fR\|(3)
345.IX Subsection "Debugging"
346\&\fIbn_check_top()\fR verifies that \f(CW\*(C`((a)\->top >= 0 && (a)\->top
347<= (a)\->dmax)\*(C'\fR. A violation will cause the program to abort.
348.PP
349\&\fIbn_print()\fR prints \fBa\fR to stderr. \fIbn_dump()\fR prints \fBn\fR words at \fBd\fR
350(in reverse order, i.e. most significant word first) to stderr.
351.PP
352\&\fIbn_set_max()\fR makes \fBa\fR a static number with a \fBdmax\fR of its current size.
353This is used by \fIbn_set_low()\fR and \fIbn_set_high()\fR to make \fBr\fR a read-only
354\&\fB\s-1BIGNUM\s0\fR that contains the \fBn\fR low or high words of \fBa\fR.
355.PP
356If \fB\s-1BN_DEBUG\s0\fR is not defined, \fIbn_check_top()\fR, \fIbn_print()\fR, \fIbn_dump()\fR
357and \fIbn_set_max()\fR are defined as empty macros.
358.SH "SEE ALSO"
359.IX Header "SEE ALSO"
360\&\fIbn\fR\|(3)