1 .\" $OpenBSD: BN_BLINDING_new.3,v 1.6 2016/12/10 21:13:25 schwarze Exp $
2 .\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400
4 .\" This file was written by Nils Larsch <nils@openssl.org>.
5 .\" Copyright (c) 2005, 2008, 2013, 2015 The OpenSSL Project.
6 .\" All rights reserved.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\" notice, this list of conditions and the following disclaimer in
17 .\" the documentation and/or other materials provided with the
20 .\" 3. All advertising materials mentioning features or use of this
21 .\" software must display the following acknowledgment:
22 .\" "This product includes software developed by the OpenSSL Project
23 .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
25 .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 .\" endorse or promote products derived from this software without
27 .\" prior written permission. For written permission, please contact
28 .\" openssl-core@openssl.org.
30 .\" 5. Products derived from this software may not be called "OpenSSL"
31 .\" nor may "OpenSSL" appear in their names without prior written
32 .\" permission of the OpenSSL Project.
34 .\" 6. Redistributions of any form whatsoever must retain the following
36 .\" "This product includes software developed by the OpenSSL Project
37 .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
39 .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
52 .Dd $Mdocdate: December 10 2016 $
57 .Nm BN_BLINDING_free ,
58 .Nm BN_BLINDING_update ,
59 .Nm BN_BLINDING_convert ,
60 .Nm BN_BLINDING_invert ,
61 .Nm BN_BLINDING_convert_ex ,
62 .Nm BN_BLINDING_invert_ex ,
63 .Nm BN_BLINDING_get_thread_id ,
64 .Nm BN_BLINDING_set_thread_id ,
65 .Nm BN_BLINDING_thread_id ,
66 .Nm BN_BLINDING_get_flags ,
67 .Nm BN_BLINDING_set_flags ,
68 .Nm BN_BLINDING_create_param
69 .Nd blinding related BIGNUM functions
75 .Fa "const BIGNUM *Ai"
83 .Fo BN_BLINDING_update
88 .Fo BN_BLINDING_convert
94 .Fo BN_BLINDING_invert
100 .Fo BN_BLINDING_convert_ex
107 .Fo BN_BLINDING_invert_ex
109 .Fa "const BIGNUM *r"
113 .Fd #ifndef OPENSSL_NO_DEPRECATED
115 .Fo BN_BLINDING_get_thread_id
116 .Fa "const BN_BLINDING *"
119 .Fo BN_BLINDING_set_thread_id
124 .Ft CRYPTO_THREADID *
125 .Fo BN_BLINDING_thread_id
129 .Fo BN_BLINDING_get_flags
130 .Fa "const BN_BLINDING *"
133 .Fo BN_BLINDING_set_flags
138 .Fo BN_BLINDING_create_param
140 .Fa "const BIGNUM *e"
143 .Fa "int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,\
144 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)"
145 .Fa "BN_MONT_CTX *m_ctx"
151 structure and copies the
155 values into the newly created
167 pointer, no action occurs.
169 .Fn BN_BLINDING_update
172 parameters by squaring the
176 or, after a specific number of uses and if the necessary parameters are
177 set, by re-creating the blinding parameters.
179 .Fn BN_BLINDING_convert_ex
182 with the blinding factor
188 a copy of the inverse blinding factor
192 (this is useful if an
194 object is shared among several threads).
195 .Fn BN_BLINDING_invert_ex
198 with the inverse blinding factor
204 it will be used as the inverse blinding.
206 .Fn BN_BLINDING_convert
208 .Fn BN_BLINDING_invert
209 are wrapper functions for
210 .Fn BN_BLINDING_convert_ex
212 .Fn BN_BLINDING_invert_ex
218 .Fn BN_BLINDING_thread_id
219 provides access to the
224 This is to help users provide proper locking if needed for
226 The thread ID object of a newly allocated
228 structure is initialised to the thread ID in which
232 .Fn BN_BLINDING_get_flags
236 Currently there are two supported flags:
237 .Dv BN_BLINDING_NO_UPDATE
239 .Dv BN_BLINDING_NO_RECREATE .
240 .Dv BN_BLINDING_NO_UPDATE
241 inhibits the automatic update of the
243 parameters after each use and
244 .Dv BN_BLINDING_NO_RECREATE
245 inhibits the automatic re-creation of the
247 parameters after a fixed number of uses (currently 32).
250 objects no flags are set.
251 .Fn BN_BLINDING_set_flags
256 .Fn BN_BLINDING_create_param
259 parameters using the exponent
266 can be used to pass special functions for exponentiation (normally
272 returns the newly allocated
278 .Fn BN_BLINDING_update ,
279 .Fn BN_BLINDING_convert ,
280 .Fn BN_BLINDING_invert ,
281 .Fn BN_BLINDING_convert_ex
283 .Fn BN_BLINDING_invert_ex
284 return 1 on success and 0 if an error occurred.
286 .Fn BN_BLINDING_thread_id
287 returns a pointer to the thread ID object within a
291 .Fn BN_BLINDING_get_flags
292 returns the currently set
298 .Fn BN_BLINDING_create_param
299 returns the newly created
307 .Fn BN_BLINDING_thread_id
308 was first introduced in OpenSSL 1.0.0, and it deprecates
309 .Fn BN_BLINDING_set_thread_id
311 .Fn BN_BLINDING_get_thread_id .
313 .Fn BN_BLINDING_convert_ex ,
314 .Fn BN_BLINDIND_invert_ex ,
315 .Fn BN_BLINDING_get_thread_id ,
316 .Fn BN_BLINDING_set_thread_id ,
317 .Fn BN_BLINDING_set_flags ,
318 .Fn BN_BLINDING_get_flags
320 .Fn BN_BLINDING_create_param
321 were first introduced in OpenSSL 0.9.8.
323 .An Nils Larsch Aq Mt nils@openssl.org