1 .\" $NetBSD: libcrypto.pl,v 1.3 2007/11/27 22:16:03 christos Exp $
3 .\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
6 .\" ========================================================================
7 .de Sh \" Subsection heading
15 .de Sp \" Vertical space (when we can't use .PP)
19 .de Vb \" Begin verbatim text
24 .de Ve \" End verbatim text
28 .\" Set up some character translations and predefined strings. \*(-- will
29 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
30 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
31 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
32 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
33 .\" nothing in troff, for use with C<>.
35 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
39 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
40 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
53 .\" Escape single quotes in literal strings from groff's Unicode transform.
57 .\" If the F register is turned on, we'll generate index entries on stderr for
58 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
59 .\" entries marked with X<> in POD. Of course, you'll have to process the
60 .\" output yourself in some meaningful fashion.
63 . tm Index:\\$1\t\\n%\t"\\$2"
73 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
74 .\" Fear. Run. Save yourself. No user-serviceable parts.
75 . \" fudge factors for nroff and troff
84 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
90 . \" simple accents for nroff and troff
100 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
101 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
102 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
103 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
104 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
105 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
107 . \" troff and (daisy-wheel) nroff accents
108 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
109 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
110 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
111 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
112 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
113 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
114 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
115 .ds ae a\h'-(\w'a'u*4/10)'e
116 .ds Ae A\h'-(\w'A'u*4/10)'E
117 . \" corrections for vroff
118 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
119 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
120 . \" for low resolution devices (crt and lpr)
121 .if \n(.H>23 .if \n(.V>19 \
134 .\" ========================================================================
136 .IX Title "BN_BLINDING_new 3"
137 .TH BN_BLINDING_new 3 "2008-08-06" "1.1.0-dev" "OpenSSL"
138 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
139 .\" way too many mistakes in technical documents.
143 BN_BLINDING_new, BN_BLINDING_free, BN_BLINDING_update, BN_BLINDING_convert,
144 BN_BLINDING_invert, BN_BLINDING_convert_ex, BN_BLINDING_invert_ex,
145 BN_BLINDING_get_thread_id, BN_BLINDING_set_thread_id, BN_BLINDING_get_flags,
146 BN_BLINDING_set_flags, BN_BLINDING_create_param \- blinding related BIGNUM
151 .IX Header "SYNOPSIS"
153 \& #include <openssl/bn.h>
155 \& BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai,
157 \& void BN_BLINDING_free(BN_BLINDING *b);
158 \& int BN_BLINDING_update(BN_BLINDING *b,BN_CTX *ctx);
159 \& int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
160 \& int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);
161 \& int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b,
163 \& int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b,
165 \& #ifndef OPENSSL_NO_DEPRECATED
166 \& unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *);
167 \& void BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long);
169 \& CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *);
170 \& unsigned long BN_BLINDING_get_flags(const BN_BLINDING *);
171 \& void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long);
172 \& BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
173 \& const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
174 \& int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
175 \& const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx),
176 \& BN_MONT_CTX *m_ctx);
179 .IX Header "DESCRIPTION"
180 \&\fIBN_BLINDING_new()\fR allocates a new \fB\s-1BN_BLINDING\s0\fR structure and copies
181 the \fBA\fR and \fBAi\fR values into the newly created \fB\s-1BN_BLINDING\s0\fR object.
183 \&\fIBN_BLINDING_free()\fR frees the \fB\s-1BN_BLINDING\s0\fR structure.
185 \&\fIBN_BLINDING_update()\fR updates the \fB\s-1BN_BLINDING\s0\fR parameters by squaring
186 the \fBA\fR and \fBAi\fR or, after specific number of uses and if the
187 necessary parameters are set, by re-creating the blinding parameters.
189 \&\fIBN_BLINDING_convert_ex()\fR multiplies \fBn\fR with the blinding factor \fBA\fR.
190 If \fBr\fR is not \s-1NULL\s0 a copy the inverse blinding factor \fBAi\fR will be
191 returned in \fBr\fR (this is useful if a \fB\s-1RSA\s0\fR object is shared amoung
192 several threads). \fIBN_BLINDING_invert_ex()\fR multiplies \fBn\fR with the
193 inverse blinding factor \fBAi\fR. If \fBr\fR is not \s-1NULL\s0 it will be used as
194 the inverse blinding.
196 \&\fIBN_BLINDING_convert()\fR and \fIBN_BLINDING_invert()\fR are wrapper
197 functions for \fIBN_BLINDING_convert_ex()\fR and \fIBN_BLINDING_invert_ex()\fR
198 with \fBr\fR set to \s-1NULL\s0.
200 \&\fIBN_BLINDING_thread_id()\fR provides access to the \fB\s-1CRYPTO_THREADID\s0\fR
201 object within the \fB\s-1BN_BLINDING\s0\fR structure. This is to help users
202 provide proper locking if needed for multi-threaded use. The \*(L"thread
203 id\*(R" object of a newly allocated \fB\s-1BN_BLINDING\s0\fR structure is
204 initialised to the thread id in which \fIBN_BLINDING_new()\fR was called.
206 \&\fIBN_BLINDING_get_flags()\fR returns the \s-1BN_BLINDING\s0 flags. Currently
207 there are two supported flags: \fB\s-1BN_BLINDING_NO_UPDATE\s0\fR and
208 \&\fB\s-1BN_BLINDING_NO_RECREATE\s0\fR. \fB\s-1BN_BLINDING_NO_UPDATE\s0\fR inhibits the
209 automatic update of the \fB\s-1BN_BLINDING\s0\fR parameters after each use
210 and \fB\s-1BN_BLINDING_NO_RECREATE\s0\fR inhibits the automatic re-creation
211 of the \fB\s-1BN_BLINDING\s0\fR parameters after a fixed number of uses (currently
212 32). In newly allocated \fB\s-1BN_BLINDING\s0\fR objects no flags are set.
213 \&\fIBN_BLINDING_set_flags()\fR sets the \fB\s-1BN_BLINDING\s0\fR parameters flags.
215 \&\fIBN_BLINDING_create_param()\fR creates new \fB\s-1BN_BLINDING\s0\fR parameters
216 using the exponent \fBe\fR and the modulus \fBm\fR. \fBbn_mod_exp\fR and
217 \&\fBm_ctx\fR can be used to pass special functions for exponentiation
218 (normally \fIBN_mod_exp_mont()\fR and \fB\s-1BN_MONT_CTX\s0\fR).
220 .IX Header "RETURN VALUES"
221 \&\fIBN_BLINDING_new()\fR returns the newly allocated \fB\s-1BN_BLINDING\s0\fR structure
222 or \s-1NULL\s0 in case of an error.
224 \&\fIBN_BLINDING_update()\fR, \fIBN_BLINDING_convert()\fR, \fIBN_BLINDING_invert()\fR,
225 \&\fIBN_BLINDING_convert_ex()\fR and \fIBN_BLINDING_invert_ex()\fR return 1 on
226 success and 0 if an error occured.
228 \&\fIBN_BLINDING_thread_id()\fR returns a pointer to the thread id object
229 within a \fB\s-1BN_BLINDING\s0\fR object.
231 \&\fIBN_BLINDING_get_flags()\fR returns the currently set \fB\s-1BN_BLINDING\s0\fR flags
232 (a \fBunsigned long\fR value).
234 \&\fIBN_BLINDING_create_param()\fR returns the newly created \fB\s-1BN_BLINDING\s0\fR
235 parameters or \s-1NULL\s0 on error.
237 .IX Header "SEE ALSO"
238 \&\fIopenssl_bn\fR\|(3)
241 BN_BLINDING_thread_id was first introduced in OpenSSL 0.9.9, and it
242 deprecates BN_BLINDING_set_thread_id and BN_BLINDING_get_thread_id.
244 BN_BLINDING_convert_ex, BN_BLINDIND_invert_ex, BN_BLINDING_get_thread_id,
245 BN_BLINDING_set_thread_id, BN_BLINDING_set_flags, BN_BLINDING_get_flags
246 and BN_BLINDING_create_param were first introduced in OpenSSL 0.9.8
249 Nils Larsch for the OpenSSL project (http://www.openssl.org).