summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/BN_BLINDING_new.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/BN_BLINDING_new.3')
-rw-r--r--src/lib/libcrypto/man/BN_BLINDING_new.3269
1 files changed, 269 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/BN_BLINDING_new.3 b/src/lib/libcrypto/man/BN_BLINDING_new.3
new file mode 100644
index 0000000000..c65d79c3bc
--- /dev/null
+++ b/src/lib/libcrypto/man/BN_BLINDING_new.3
@@ -0,0 +1,269 @@
1.Dd $Mdocdate: February 23 2015 $
2.Dt BN_BLINDING_NEW 3
3.Os
4.Sh NAME
5.Nm BN_BLINDING_new ,
6.Nm BN_BLINDING_free ,
7.Nm BN_BLINDING_update ,
8.Nm BN_BLINDING_convert ,
9.Nm BN_BLINDING_invert ,
10.Nm BN_BLINDING_convert_ex ,
11.Nm BN_BLINDING_invert_ex ,
12.Nm BN_BLINDING_get_thread_id ,
13.Nm BN_BLINDING_set_thread_id ,
14.Nm BN_BLINDING_thread_id ,
15.Nm BN_BLINDING_get_flags ,
16.Nm BN_BLINDING_set_flags ,
17.Nm BN_BLINDING_create_param
18.Nd blinding related BIGNUM functions
19.Sh SYNOPSIS
20.In openssl/bn.h
21.Ft BN_BLINDING *
22.Fo BN_BLINDING_new
23.Fa "const BIGNUM *A"
24.Fa "const BIGNUM *Ai"
25.Fa "BIGNUM *mod"
26.Fc
27.Ft void
28.Fo BN_BLINDING_free
29.Fa "BN_BLINDING *b"
30.Fc
31.Ft int
32.Fo BN_BLINDING_update
33.Fa "BN_BLINDING *b"
34.Fa "BN_CTX *ctx"
35.Fc
36.Ft int
37.Fo BN_BLINDING_convert
38.Fa "BIGNUM *n"
39.Fa "BN_BLINDING *b"
40.Fa "BN_CTX *ctx"
41.Fc
42.Ft int
43.Fo BN_BLINDING_invert
44.Fa "BIGNUM *n"
45.Fa "BN_BLINDING *b"
46.Fa "BN_CTX *ctx"
47.Fc
48.Ft int
49.Fo BN_BLINDING_convert_ex
50.Fa "BIGNUM *n"
51.Fa "BIGNUM *r"
52.Fa "BN_BLINDING *b"
53.Fa "BN_CTX *ctx"
54.Fc
55.Ft int
56.Fo BN_BLINDING_invert_ex
57.Fa "BIGNUM *n"
58.Fa "const BIGNUM *r"
59.Fa "BN_BLINDING *b"
60.Fa "BN_CTX *ctx"
61.Fc
62.Fd #ifndef OPENSSL_NO_DEPRECATED
63.Ft unsigned long
64.Fo BN_BLINDING_get_thread_id
65.Fa "const BN_BLINDING *"
66.Fc
67.Ft void
68.Fo BN_BLINDING_set_thread_id
69.Fa "BN_BLINDING *"
70.Fa "unsigned long"
71.Fc
72.Fd #endif
73.Ft CRYPTO_THREADID *
74.Fo BN_BLINDING_thread_id
75.Fa "BN_BLINDING *"
76.Fc
77.Ft unsigned long
78.Fo BN_BLINDING_get_flags
79.Fa "const BN_BLINDING *"
80.Fc
81.Ft void
82.Fo BN_BLINDING_set_flags
83.Fa "BN_BLINDING *"
84.Fa "unsigned long"
85.Fc
86.Ft BN_BLINDING *
87.Fo BN_BLINDING_create_param
88.Fa "BN_BLINDING *b"
89.Fa "const BIGNUM *e"
90.Fa "BIGNUM *m"
91.Fa "BN_CTX *ctx"
92.Fa "int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,\
93 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)"
94.Fa "BN_MONT_CTX *m_ctx"
95.Fc
96.Sh DESCRIPTION
97.Fn BN_BLINDING_new
98allocates a new
99.Vt BN_BLINDING
100structure and copies the
101.Fa A
102and
103.Fa \&Ai
104values into the newly created
105.Vt BN_BLINDING
106object.
107.Pp
108.Fn BN_BLINDING_free
109frees the
110.Vt BN_BLINDING
111structure.
112.Pp
113.Fn BN_BLINDING_update
114updates the
115.Vt BN_BLINDING
116parameters by squaring the
117.Fa A
118and
119.Fa \&Ai
120or, after specific number of uses and if the necessary parameters are
121set, by re-creating the blinding parameters.
122.Pp
123.Fn BN_BLINDING_convert_ex
124multiplies
125.Fa n
126with the blinding factor
127.Fa A .
128If
129.Fa r
130is not
131.Dv NULL ,
132a copy of the inverse blinding factor
133.Fa \&Ai
134will be returned in
135.Fa r
136(this is useful if a
137.Vt RSA
138object is shared among several threads).
139.Fn BN_BLINDING_invert_ex
140multiplies
141.Fa n
142with the inverse blinding factor
143.Fa \&Ai .
144If
145.Fa r
146is not
147.Dv NULL ,
148it will be used as the inverse blinding.
149.Pp
150.Fn BN_BLINDING_convert
151and
152.Fn BN_BLINDING_invert
153are wrapper functions for
154.Fn BN_BLINDING_convert_ex
155and
156.Fn BN_BLINDING_invert_ex
157with
158.Fa r
159set to
160.Dv NULL .
161.Pp
162.Fn BN_BLINDING_thread_id
163provides access to the
164.Vt CRYPTO_THREADID
165object within the
166.Vt BN_BLINDING
167structure.
168This is to help users provide proper locking if needed for
169multi-threaded use.
170The "thread id" object of a newly allocated
171.Vt BN_BLINDING
172structure is initialised to the thread id in which
173.Fn BN_BLINDING_new
174was called.
175.Pp
176.Fn BN_BLINDING_get_flags
177returns the
178.Dv BN_BLINDING_*
179flags.
180Currently there are two supported flags:
181.Dv BN_BLINDING_NO_UPDATE
182and
183.Dv BN_BLINDING_NO_RECREATE .
184.Dv BN_BLINDING_NO_UPDATE
185inhibits the automatic update of the
186.Vt BN_BLINDING
187parameters after each use and
188.Dv BN_BLINDING_NO_RECREATE
189inhibits the automatic re-creation of the
190.Vt BN_BLINDING
191parameters after a fixed number of uses (currently 32).
192In newly allocated
193.Vt BN_BLINDING
194objects no flags are set.
195.Fn BN_BLINDING_set_flags
196sets the
197.Dv BN_BLINDING_*
198parameters flags.
199.Pp
200.Fn BN_BLINDING_create_param
201creates new
202.Vt BN_BLINDING
203parameters using the exponent
204.Fa e
205and the modulus
206.Fa m .
207.Fa bn_mod_exp
208and
209.Fa m_ctx
210can be used to pass special functions for exponentiation (normally
211.Xr BN_mod_exp_mont 3
212and
213.Vt BN_MONT_CTX Ns ).
214.Sh RETURN VALUES
215.Fn BN_BLINDING_new
216returns the newly allocated
217.Vt BN_BLINDING
218structure or
219.Dv NULL
220in case of an error.
221.Pp
222.Fn BN_BLINDING_update ,
223.Fn BN_BLINDING_convert ,
224.Fn BN_BLINDING_invert ,
225.Fn BN_BLINDING_convert_ex
226and
227.Fn BN_BLINDING_invert_ex
228return 1 on success and 0 if an error occured.
229.Pp
230.Fn BN_BLINDING_thread_id
231returns a pointer to the thread id object within a
232.Vt BN_BLINDING
233object.
234.Pp
235.Fn BN_BLINDING_get_flags
236returns the currently set
237.Dv BN_BLINDING_*
238flags (an
239.Vt unsigned long
240value).
241.Pp
242.Fn BN_BLINDING_create_param
243returns the newly created
244.Vt BN_BLINDING
245parameters or
246.Dv NULL
247on error.
248.Sh SEE ALSO
249.Xr bn 3
250.Sh HISTORY
251.Fn BN_BLINDING_thread_id
252was first introduced in OpenSSL 1.0.0, and it deprecates
253.Fn BN_BLINDING_set_thread_id
254and
255.Fn BN_BLINDING_get_thread_id .
256.Pp
257.Fn BN_BLINDING_convert_ex ,
258.Fn BN_BLINDIND_invert_ex ,
259.Fn BN_BLINDING_get_thread_id ,
260.Fn BN_BLINDING_set_thread_id ,
261.Fn BN_BLINDING_set_flags ,
262.Fn BN_BLINDING_get_flags
263and
264.Fn BN_BLINDING_create_param
265were first introduced in OpenSSL 0.9.8
266.Sh AUTHORS
267.An Nils Larsch
268for
269.Lk http://www.openssl.org/ "the OpenSSL project" .