Lines Matching refs:B
67 B<BIGNUM> implementation. They are described here to facilitate
86 The integer value is stored in B<d>, a malloc()ed array of words (B<BN_ULONG>),
87 least significant word first. A B<BN_ULONG> can be either 16, 32 or 64 bits
88 in size, depending on the 'number of bits' (B<BITS2>) specified in
91 B<dmax> is the size of the B<d> array that has been allocated. B<top>
93 bn.top=1. B<neg> is 1 if the number is negative. When a B<BIGNUM> is
94 B<0>, the B<d> field can be B<NULL> and B<top> == B<0>.
96 B<flags> is a bit field of flags which are defined in C<openssl/bn.h>. The
97 flags begin with B<BN_FLG_>. The macros BN_set_flags(b, n) and
98 BN_get_flags(b, n) exist to enable or fetch flag(s) B<n> from B<BIGNUM>
99 structure B<b>.
102 B<BIGNUM> variables during their execution. Since dynamic memory
103 allocation to create B<BIGNUM>s is rather expensive when used in
104 conjunction with repeated subroutine calls, the B<BN_CTX> structure is
105 used. This structure contains B<BN_CTX_NUM> B<BIGNUM>s, see
113 bn_mul_words(B<rp>, B<ap>, B<num>, B<w>) operates on the B<num> word
114 arrays B<rp> and B<ap>. It computes B<ap> * B<w>, places the result
115 in B<rp>, and returns the high word (carry).
117 bn_mul_add_words(B<rp>, B<ap>, B<num>, B<w>) operates on the B<num>
118 word arrays B<rp> and B<ap>. It computes B<ap> * B<w> + B<rp>, places
119 the result in B<rp>, and returns the high word (carry).
121 bn_sqr_words(B<rp>, B<ap>, B<n>) operates on the B<num> word array
122 B<ap> and the 2*B<num> word array B<ap>. It computes B<ap> * B<ap>
123 word-wise, and places the low and high bytes of the result in B<rp>.
125 bn_div_words(B<h>, B<l>, B<d>) divides the two word number (B<h>, B<l>)
126 by B<d> and returns the result.
128 bn_add_words(B<rp>, B<ap>, B<bp>, B<num>) operates on the B<num> word
129 arrays B<ap>, B<bp> and B<rp>. It computes B<ap> + B<bp>, places the
130 result in B<rp>, and returns the high word (carry).
132 bn_sub_words(B<rp>, B<ap>, B<bp>, B<num>) operates on the B<num> word
133 arrays B<ap>, B<bp> and B<rp>. It computes B<ap> - B<bp>, places the
134 result in B<rp>, and returns the carry (1 if B<bp> E<gt> B<ap>, 0
137 bn_mul_comba4(B<r>, B<a>, B<b>) operates on the 4 word arrays B<a> and
138 B<b> and the 8 word array B<r>. It computes B<a>*B<b> and places the
139 result in B<r>.
141 bn_mul_comba8(B<r>, B<a>, B<b>) operates on the 8 word arrays B<a> and
142 B<b> and the 16 word array B<r>. It computes B<a>*B<b> and places the
143 result in B<r>.
145 bn_sqr_comba4(B<r>, B<a>, B<b>) operates on the 4 word arrays B<a> and
146 B<b> and the 8 word array B<r>.
148 bn_sqr_comba8(B<r>, B<a>, B<b>) operates on the 8 word arrays B<a> and
149 B<b> and the 16 word array B<r>.
153 bn_cmp_words(B<a>, B<b>, B<n>) operates on the B<n> word arrays B<a>
154 and B<b>. It returns 1, 0 and -1 if B<a> is greater than, equal and
155 less than B<b>.
157 bn_mul_normal(B<r>, B<a>, B<na>, B<b>, B<nb>) operates on the B<na>
158 word array B<a>, the B<nb> word array B<b> and the B<na>+B<nb> word
159 array B<r>. It computes B<a>*B<b> and places the result in B<r>.
161 bn_mul_low_normal(B<r>, B<a>, B<b>, B<n>) operates on the B<n> word
162 arrays B<r>, B<a> and B<b>. It computes the B<n> low words of
163 B<a>*B<b> and places the result in B<r>.
165 bn_mul_recursive(B<r>, B<a>, B<b>, B<n2>, B<dna>, B<dnb>, B<t>) operates
166 on the word arrays B<a> and B<b> of length B<n2>+B<dna> and B<n2>+B<dnb>
167 (B<dna> and B<dnb> are currently allowed to be 0 or negative) and the 2*B<n2>
168 word arrays B<r> and B<t>. B<n2> must be a power of 2. It computes
169 B<a>*B<b> and places the result in B<r>.
171 bn_mul_part_recursive(B<r>, B<a>, B<b>, B<n>, B<tna>, B<tnb>, B<tmp>)
172 operates on the word arrays B<a> and B<b> of length B<n>+B<tna> and
173 B<n>+B<tnb> and the 4*B<n> word arrays B<r> and B<tmp>.
175 bn_mul_low_recursive(B<r>, B<a>, B<b>, B<n2>, B<tmp>) operates on the
176 B<n2> word arrays B<r> and B<tmp> and the B<n2>/2 word arrays B<a>
177 and B<b>.
182 B<BN_MULL_SIZE_NORMAL> and the size is an exact multiple of the word
184 B<BN_MULL_SIZE_NORMAL>.
186 bn_sqr_normal(B<r>, B<a>, B<n>, B<tmp>) operates on the B<n> word array
187 B<a> and the 2*B<n> word arrays B<tmp> and B<r>.
193 mul(B<r>, B<a>, B<w>, B<c>) computes B<w>*B<a>+B<c> and places the
194 low word of the result in B<r> and the high word in B<c>.
196 mul_add(B<r>, B<a>, B<w>, B<c>) computes B<w>*B<a>+B<r>+B<c> and
197 places the low word of the result in B<r> and the high word in B<c>.
199 sqr(B<r0>, B<r1>, B<a>) computes B<a>*B<a> and places the low word
200 of the result in B<r0> and the high word in B<r1>.
204 bn_expand() ensures that B<b> has enough space for a B<bits> bit
205 number. bn_wexpand() ensures that B<b> has enough space for an
206 B<n> word number. If the number has to be expanded, both macros
207 call bn_expand2(), which allocates a new B<d> array and copies the
208 data. They return B<NULL> on error, B<b> otherwise.
210 The bn_fix_top() macro reduces B<a-E<gt>top> to point to the most
211 significant non-zero word plus one when B<a> has shrunk.
218 bn_print() prints B<a> to stderr. bn_dump() prints B<n> words at B<d>
221 bn_set_max() makes B<a> a static number with a B<dmax> of its current size.
222 This is used by bn_set_low() and bn_set_high() to make B<r> a read-only
223 B<BIGNUM> that contains the B<n> low or high words of B<a>.
225 If B<BN_DEBUG> is not defined, bn_check_top(), bn_print(), bn_dump()