diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/man/EC_POINT_new.3 | 497 |
1 files changed, 125 insertions, 372 deletions
diff --git a/src/lib/libcrypto/man/EC_POINT_new.3 b/src/lib/libcrypto/man/EC_POINT_new.3 index db6280fce7..0a797f8bc9 100644 --- a/src/lib/libcrypto/man/EC_POINT_new.3 +++ b/src/lib/libcrypto/man/EC_POINT_new.3 | |||
@@ -1,54 +1,20 @@ | |||
1 | .\" $OpenBSD: EC_POINT_new.3,v 1.17 2025/03/08 17:04:07 tb Exp $ | 1 | .\" $OpenBSD: EC_POINT_new.3,v 1.21 2025/06/13 18:34:00 schwarze Exp $ |
2 | .\" full merge up to: OpenSSL 50db8163 Jul 30 16:56:41 2018 +0100 | ||
3 | .\" | 2 | .\" |
4 | .\" This file was written by Matt Caswell <matt@openssl.org>. | 3 | .\" Copyright (c) 2025 Theo Buehler <tb@openbsd.org> |
5 | .\" Copyright (c) 2013, 2016 The OpenSSL Project. All rights reserved. | ||
6 | .\" | 4 | .\" |
7 | .\" Redistribution and use in source and binary forms, with or without | 5 | .\" Permission to use, copy, modify, and distribute this software for any |
8 | .\" modification, are permitted provided that the following conditions | 6 | .\" purpose with or without fee is hereby granted, provided that the above |
9 | .\" are met: | 7 | .\" copyright notice and this permission notice appear in all copies. |
10 | .\" | 8 | .\" |
11 | .\" 1. Redistributions of source code must retain the above copyright | 9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
12 | .\" notice, this list of conditions and the following disclaimer. | 10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
13 | .\" | 16 | .\" |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | 17 | .Dd $Mdocdate: June 13 2025 $ |
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: March 8 2025 $ | ||
52 | .Dt EC_POINT_NEW 3 | 18 | .Dt EC_POINT_NEW 3 |
53 | .Os | 19 | .Os |
54 | .Sh NAME | 20 | .Sh NAME |
@@ -56,24 +22,12 @@ | |||
56 | .Nm EC_POINT_free , | 22 | .Nm EC_POINT_free , |
57 | .Nm EC_POINT_clear_free , | 23 | .Nm EC_POINT_clear_free , |
58 | .Nm EC_POINT_copy , | 24 | .Nm EC_POINT_copy , |
59 | .Nm EC_POINT_dup , | 25 | .Nm EC_POINT_dup |
60 | .Nm EC_POINT_set_to_infinity , | 26 | .Nd allocate, free and copy elliptic curve points |
61 | .Nm EC_POINT_set_affine_coordinates , | ||
62 | .Nm EC_POINT_set_affine_coordinates_GFp , | ||
63 | .Nm EC_POINT_get_affine_coordinates , | ||
64 | .Nm EC_POINT_get_affine_coordinates_GFp , | ||
65 | .Nm EC_POINT_set_compressed_coordinates , | ||
66 | .Nm EC_POINT_set_compressed_coordinates_GFp , | ||
67 | .Nm EC_POINT_point2oct , | ||
68 | .Nm EC_POINT_oct2point , | ||
69 | .Nm EC_POINT_point2bn , | ||
70 | .Nm EC_POINT_bn2point , | ||
71 | .Nm EC_POINT_point2hex , | ||
72 | .Nm EC_POINT_hex2point | ||
73 | .Nd create, destroy, and manipulate EC_POINT objects | ||
74 | .Sh SYNOPSIS | 27 | .Sh SYNOPSIS |
28 | .Lb libcrypto | ||
75 | .In openssl/ec.h | 29 | .In openssl/ec.h |
76 | .In openssl/bn.h | 30 | .Pp |
77 | .Ft EC_POINT * | 31 | .Ft EC_POINT * |
78 | .Fo EC_POINT_new | 32 | .Fo EC_POINT_new |
79 | .Fa "const EC_GROUP *group" | 33 | .Fa "const EC_GROUP *group" |
@@ -93,126 +47,32 @@ | |||
93 | .Fc | 47 | .Fc |
94 | .Ft EC_POINT * | 48 | .Ft EC_POINT * |
95 | .Fo EC_POINT_dup | 49 | .Fo EC_POINT_dup |
96 | .Fa "const EC_POINT *src" | 50 | .Fa "const EC_POINT *point" |
97 | .Fa "const EC_GROUP *group" | ||
98 | .Fc | ||
99 | .Ft int | ||
100 | .Fo EC_POINT_set_to_infinity | ||
101 | .Fa "const EC_GROUP *group" | ||
102 | .Fa "EC_POINT *point" | ||
103 | .Fc | ||
104 | .Ft int | ||
105 | .Fo EC_POINT_set_affine_coordinates | ||
106 | .Fa "const EC_GROUP *group" | ||
107 | .Fa "EC_POINT *p" | ||
108 | .Fa "const BIGNUM *x" | ||
109 | .Fa "const BIGNUM *y" | ||
110 | .Fa "BN_CTX *ctx" | ||
111 | .Fc | ||
112 | .Ft int | ||
113 | .Fo EC_POINT_set_affine_coordinates_GFp | ||
114 | .Fa "const EC_GROUP *group" | ||
115 | .Fa "EC_POINT *p" | ||
116 | .Fa "const BIGNUM *x" | ||
117 | .Fa "const BIGNUM *y" | ||
118 | .Fa "BN_CTX *ctx" | ||
119 | .Fc | ||
120 | .Ft int | ||
121 | .Fo EC_POINT_get_affine_coordinates | ||
122 | .Fa "const EC_GROUP *group" | 51 | .Fa "const EC_GROUP *group" |
123 | .Fa "const EC_POINT *p" | ||
124 | .Fa "BIGNUM *x" | ||
125 | .Fa "BIGNUM *y" | ||
126 | .Fa "BN_CTX *ctx" | ||
127 | .Fc | ||
128 | .Ft int | ||
129 | .Fo EC_POINT_get_affine_coordinates_GFp | ||
130 | .Fa "const EC_GROUP *group" | ||
131 | .Fa "const EC_POINT *p" | ||
132 | .Fa "BIGNUM *x" | ||
133 | .Fa "BIGNUM *y" | ||
134 | .Fa "BN_CTX *ctx" | ||
135 | .Fc | ||
136 | .Ft int | ||
137 | .Fo EC_POINT_set_compressed_coordinates | ||
138 | .Fa "const EC_GROUP *group" | ||
139 | .Fa "EC_POINT *p" | ||
140 | .Fa "const BIGNUM *x" | ||
141 | .Fa "int y_bit" | ||
142 | .Fa "BN_CTX *ctx" | ||
143 | .Fc | ||
144 | .Ft int | ||
145 | .Fo EC_POINT_set_compressed_coordinates_GFp | ||
146 | .Fa "const EC_GROUP *group" | ||
147 | .Fa "EC_POINT *p" | ||
148 | .Fa "const BIGNUM *x" | ||
149 | .Fa "int y_bit" | ||
150 | .Fa "BN_CTX *ctx" | ||
151 | .Fc | ||
152 | .Ft size_t | ||
153 | .Fo EC_POINT_point2oct | ||
154 | .Fa "const EC_GROUP *group" | ||
155 | .Fa "const EC_POINT *p" | ||
156 | .Fa "point_conversion_form_t form" | ||
157 | .Fa "unsigned char *buf" | ||
158 | .Fa "size_t len" | ||
159 | .Fa "BN_CTX *ctx" | ||
160 | .Fc | ||
161 | .Ft int | ||
162 | .Fo EC_POINT_oct2point | ||
163 | .Fa "const EC_GROUP *group" | ||
164 | .Fa "EC_POINT *p" | ||
165 | .Fa "const unsigned char *buf" | ||
166 | .Fa "size_t len" | ||
167 | .Fa "BN_CTX *ctx" | ||
168 | .Fc | ||
169 | .Ft BIGNUM * | ||
170 | .Fo EC_POINT_point2bn | ||
171 | .Fa "const EC_GROUP *" | ||
172 | .Fa "const EC_POINT *" | ||
173 | .Fa "point_conversion_form_t form" | ||
174 | .Fa "BIGNUM *" | ||
175 | .Fa "BN_CTX *" | ||
176 | .Fc | ||
177 | .Ft EC_POINT * | ||
178 | .Fo EC_POINT_bn2point | ||
179 | .Fa "const EC_GROUP *" | ||
180 | .Fa "const BIGNUM *" | ||
181 | .Fa "EC_POINT *" | ||
182 | .Fa "BN_CTX *" | ||
183 | .Fc | ||
184 | .Ft char * | ||
185 | .Fo EC_POINT_point2hex | ||
186 | .Fa "const EC_GROUP *" | ||
187 | .Fa "const EC_POINT *" | ||
188 | .Fa "point_conversion_form_t form" | ||
189 | .Fa "BN_CTX *" | ||
190 | .Fc | ||
191 | .Ft EC_POINT * | ||
192 | .Fo EC_POINT_hex2point | ||
193 | .Fa "const EC_GROUP *" | ||
194 | .Fa "const char *" | ||
195 | .Fa "EC_POINT *" | ||
196 | .Fa "BN_CTX *" | ||
197 | .Fc | 52 | .Fc |
198 | .Sh DESCRIPTION | 53 | .Sh DESCRIPTION |
199 | An | 54 | An |
200 | .Vt EC_POINT | 55 | .Vt EC_POINT |
201 | represents a point on a curve. | 56 | object holds a point on the elliptic curve represented by an |
202 | A curve is represented by an | 57 | .Vt EC_GROUP . |
203 | .Vt EC_GROUP | 58 | The details of the internal representation depend on the group |
204 | object created by the functions described in | 59 | and should never be an application's concern since the EC library |
205 | .Xr EC_GROUP_new 3 . | 60 | has API to set a point's coordinates, |
61 | .Xr EC_POINT_set_affine_coordinates 3 . | ||
206 | .Pp | 62 | .Pp |
207 | A new point is constructed by calling the function | ||
208 | .Fn EC_POINT_new | 63 | .Fn EC_POINT_new |
209 | and providing the | 64 | allocates and initializes an |
210 | .Fa group | 65 | .Vt EC_POINT |
211 | object that the point relates to. | 66 | object to be used with the |
67 | .Fa group . | ||
68 | Before explicitly setting its coordinates, the returned | ||
69 | .Vt EC_POINT | ||
70 | is invalid. | ||
212 | .Pp | 71 | .Pp |
213 | .Fn EC_POINT_free | 72 | .Fn EC_POINT_free |
214 | frees the memory associated with the | 73 | frees |
215 | .Vt EC_POINT . | 74 | .Fa point |
75 | and all memory associated with it. | ||
216 | If | 76 | If |
217 | .Fa point | 77 | .Fa point |
218 | is a | 78 | is a |
@@ -220,236 +80,129 @@ is a | |||
220 | pointer, no action occurs. | 80 | pointer, no action occurs. |
221 | .Pp | 81 | .Pp |
222 | .Fn EC_POINT_clear_free | 82 | .Fn EC_POINT_clear_free |
223 | destroys any sensitive data held within the | 83 | is intended to destroy sensitive data held in |
224 | .Vt EC_POINT | ||
225 | and then frees its memory. | ||
226 | If | ||
227 | .Fa point | 84 | .Fa point |
228 | is a | 85 | in addition to freeing all memory associated with it. |
229 | .Dv NULL | 86 | Since elliptic curve points usually hold public data, this |
230 | pointer, no action occurs. | 87 | is rarely needed. |
88 | In LibreSSL, | ||
89 | .Fn EC_POINT_free | ||
90 | and | ||
91 | .Fn EC_POINT_clear_free | ||
92 | behave identically. | ||
231 | .Pp | 93 | .Pp |
232 | .Fn EC_POINT_copy | 94 | .Fn EC_POINT_copy |
233 | copies the point | 95 | copies the internal representation of |
234 | .Fa src | 96 | .Fa src |
235 | into | 97 | into |
236 | .Fa dst . | 98 | .Fa dst . |
237 | Both | 99 | If |
238 | .Fa src | 100 | .Fa src |
239 | and | 101 | and |
240 | .Fa dst | 102 | .Fa dst |
241 | must use the same | 103 | are identical, no action occurs. |
242 | .Vt EC_METHOD . | 104 | Both |
243 | .Pp | ||
244 | .Fn EC_POINT_dup | ||
245 | creates a new | ||
246 | .Vt EC_POINT | ||
247 | object and copies the content from | ||
248 | .Fa src | 105 | .Fa src |
249 | to the newly created | ||
250 | .Vt EC_POINT | ||
251 | object. | ||
252 | .Pp | ||
253 | A valid point on a curve is the special point at infinity. | ||
254 | A point is set to be at infinity by calling | ||
255 | .Fn EC_POINT_set_to_infinity . | ||
256 | .Pp | ||
257 | The affine coordinates for a point describe a point in terms of its | ||
258 | .Fa x | ||
259 | and | 106 | and |
260 | .Fa y | 107 | .Fa dst |
261 | position. | 108 | should be the result of |
262 | The function | 109 | .Fn EC_POINT_new |
263 | .Fn EC_POINT_set_affine_coordinates | 110 | with the same |
264 | sets the | 111 | .Fa group |
265 | .Fa x | 112 | argument, although |
266 | and | 113 | .Fn EC_POINT_copy |
267 | .Fa y | 114 | cannot check that. |
268 | coordinates for the point | ||
269 | .Fa p | ||
270 | defined over the curve given in | ||
271 | .Fa group . | ||
272 | The function | ||
273 | .Fn EC_POINT_get_affine_coordinates | ||
274 | sets | ||
275 | .Fa x | ||
276 | and | ||
277 | .Fa y , | ||
278 | either of which may be | ||
279 | .Dv NULL , | ||
280 | to the corresponding coordinates of | ||
281 | .Fa p . | ||
282 | .Pp | ||
283 | The functions | ||
284 | .Fn EC_POINT_set_affine_coordinates_GFp | ||
285 | is a deprecated synonym for | ||
286 | .Fn EC_POINT_set_affine_coordinates | ||
287 | and the function | ||
288 | .Fn EC_POINT_get_affine_coordinates_GFp | ||
289 | is a deprecated synonym for | ||
290 | .Fn EC_POINT_get_affine_coordinates . | ||
291 | .Pp | ||
292 | Points can also be described in terms of their compressed coordinates. | ||
293 | For a point | ||
294 | .Pq Fa x , y , | ||
295 | for any given value for | ||
296 | .Fa x | ||
297 | such that the point is on the curve, there will only ever be two | ||
298 | possible values for | ||
299 | .Fa y . | ||
300 | Therefore, a point can be set using the | ||
301 | .Fn EC_POINT_set_compressed_coordinates | ||
302 | function where | ||
303 | .Fa x | ||
304 | is the x coordinate and | ||
305 | .Fa y_bit | ||
306 | is a value 0 or 1 to identify which of the two possible values for y | ||
307 | should be used. | ||
308 | .Pp | ||
309 | The functions | ||
310 | .Fn EC_POINT_set_compressed_coordinates_GFp | ||
311 | is a deprecated synonym for | ||
312 | .Fn EC_POINT_set_compressed_coordinates . | ||
313 | .Pp | ||
314 | In addition | ||
315 | .Vt EC_POINT Ns s | ||
316 | can be converted to and from various external representations. | ||
317 | Supported representations are octet strings, | ||
318 | .Vt BIGNUM Ns s , | ||
319 | and hexadecimal. | ||
320 | The format of the external representation is described by the | ||
321 | point_conversion_form. | ||
322 | See | ||
323 | .Xr EC_GROUP_copy 3 | ||
324 | for a description of point_conversion_form. | ||
325 | Octet strings are stored in a buffer along with an associated buffer | ||
326 | length. | ||
327 | A point held in a | ||
328 | .Vt BIGNUM | ||
329 | is calculated by converting the point to an octet string and then | ||
330 | converting that octet string into a | ||
331 | .Vt BIGNUM | ||
332 | integer. | ||
333 | Points in hexadecimal format are stored in a NUL terminated character | ||
334 | string where each character is one of the printable values 0-9 or A-F | ||
335 | (or a-f). | ||
336 | .Pp | ||
337 | The functions | ||
338 | .Fn EC_POINT_point2oct , | ||
339 | .Fn EC_POINT_oct2point , | ||
340 | .Fn EC_POINT_point2bn , | ||
341 | .Fn EC_POINT_bn2point , | ||
342 | .Fn EC_POINT_point2hex , | ||
343 | and | ||
344 | .Fn EC_POINT_hex2point | ||
345 | convert from and to | ||
346 | .Vt EC_POINT Ns s | ||
347 | for the formats octet string, | ||
348 | .Vt BIGNUM , | ||
349 | and hexadecimal, respectively. | ||
350 | .Pp | ||
351 | The function | ||
352 | .Fn EC_POINT_point2oct | ||
353 | must be supplied with a | ||
354 | .Fa buf | ||
355 | long enough to store the octet string. | ||
356 | The return value provides the number of octets stored. | ||
357 | Calling the function with a | ||
358 | .Dv NULL | ||
359 | .Fa buf | ||
360 | will not perform the conversion but will still return the required | ||
361 | buffer length. | ||
362 | .Pp | 115 | .Pp |
363 | The function | 116 | .Fn EC_POINT_dup |
364 | .Fn EC_POINT_point2hex | 117 | creates a deep copy of |
365 | will allocate sufficient memory to store the hexadecimal string. | 118 | .Fa point |
366 | It is the caller's responsibility to free this memory with a subsequent | 119 | by combining |
367 | call to | 120 | .Fn EC_POINT_new |
368 | .Xr free 3 . | 121 | with |
122 | .Fn EC_GROUP_copy . | ||
369 | .Sh RETURN VALUES | 123 | .Sh RETURN VALUES |
370 | .Fn EC_POINT_new | 124 | .Fn EC_POINT_new |
371 | and | 125 | returns a newly allocated |
372 | .Fn EC_POINT_dup | ||
373 | return the newly allocated | ||
374 | .Vt EC_POINT | 126 | .Vt EC_POINT |
375 | or | 127 | or |
376 | .Dv NULL | 128 | .Dv NULL |
377 | on error. | 129 | on memory allocation failure. |
378 | .Pp | ||
379 | The following functions return 1 on success or 0 on error: | ||
380 | .Fn EC_POINT_copy , | ||
381 | .Fn EC_POINT_set_to_infinity , | ||
382 | .Fn EC_POINT_set_affine_coordinates , | ||
383 | .Fn EC_POINT_set_affine_coordinates_GFp , | ||
384 | .Fn EC_POINT_get_affine_coordinates , | ||
385 | .Fn EC_POINT_get_affine_coordinates_GFp , | ||
386 | .Fn EC_POINT_set_compressed_coordinates , | ||
387 | .Fn EC_POINT_set_compressed_coordinates_GFp , | ||
388 | and | ||
389 | .Fn EC_POINT_oct2point . | ||
390 | .Pp | ||
391 | .Fn EC_POINT_point2oct | ||
392 | returns the length of the required buffer, or 0 on error. | ||
393 | .Pp | ||
394 | .Fn EC_POINT_point2bn | ||
395 | returns the pointer to the | ||
396 | .Vt BIGNUM | ||
397 | supplied or | ||
398 | .Dv NULL | ||
399 | on error. | ||
400 | .Pp | 130 | .Pp |
401 | .Fn EC_POINT_bn2point | 131 | .Fn EC_POINT_copy |
402 | returns the pointer to the | 132 | returns 1 on success or 0 on error. |
403 | .Vt EC_POINT | 133 | Error conditions include memory allocation failure and that |
404 | supplied or | 134 | .Fa dst |
405 | .Dv NULL | 135 | is incompatible with the group on which |
406 | on error. | 136 | .Fa src |
407 | .Pp | 137 | is defined. |
408 | .Fn EC_POINT_point2hex | ||
409 | returns a pointer to the hex string or | ||
410 | .Dv NULL | ||
411 | on error. | ||
412 | .Pp | 138 | .Pp |
413 | .Fn EC_POINT_hex2point | 139 | .Fn EC_POINT_dup |
414 | returns the pointer to the | 140 | returns a newly allocated |
415 | .Vt EC_POINT | 141 | .Vt EC_POINT |
416 | supplied or | 142 | or |
417 | .Dv NULL | 143 | .Dv NULL |
418 | on error. | 144 | on failure. |
145 | Error conditions include memory allocation failure or that | ||
146 | .Fa group | ||
147 | is incompatible with | ||
148 | .Fa src . | ||
419 | .Sh SEE ALSO | 149 | .Sh SEE ALSO |
150 | .Xr BN_CTX_new 3 , | ||
151 | .Xr BN_is_zero 3 , | ||
152 | .Xr crypto 3 , | ||
420 | .Xr d2i_ECPKParameters 3 , | 153 | .Xr d2i_ECPKParameters 3 , |
421 | .Xr EC_GROUP_copy 3 , | 154 | .Xr EC_GROUP_check 3 , |
422 | .Xr EC_GROUP_new 3 , | 155 | .Xr EC_GROUP_get_curve_name 3 , |
156 | .Xr EC_GROUP_new_by_curve_name 3 , | ||
157 | .Xr EC_GROUP_new_curve_GFp 3 , | ||
158 | .Xr EC_KEY_METHOD_new 3 , | ||
423 | .Xr EC_KEY_new 3 , | 159 | .Xr EC_KEY_new 3 , |
424 | .Xr EC_POINT_add 3 , | 160 | .Xr EC_POINT_add 3 , |
425 | .Xr ECDH_compute_key 3 | 161 | .Xr EC_POINT_get_affine_coordinates 3 , |
162 | .Xr EC_POINT_point2oct 3 , | ||
163 | .Xr ECDH_compute_key 3 , | ||
164 | .Xr ECDSA_SIG_new 3 | ||
426 | .Sh HISTORY | 165 | .Sh HISTORY |
427 | .Fn EC_POINT_new , | 166 | .Fn EC_POINT_new , |
428 | .Fn EC_POINT_free , | 167 | .Fn EC_POINT_free , |
429 | .Fn EC_POINT_clear_free , | 168 | .Fn EC_POINT_clear_free , |
430 | .Fn EC_POINT_copy , | ||
431 | .Fn EC_POINT_set_to_infinity , | ||
432 | .Fn EC_POINT_set_affine_coordinates_GFp , | ||
433 | .Fn EC_POINT_get_affine_coordinates_GFp , | ||
434 | .Fn EC_POINT_set_compressed_coordinates_GFp , | ||
435 | .Fn EC_POINT_point2oct , | ||
436 | and | 169 | and |
437 | .Fn EC_POINT_oct2point | 170 | .Fn EC_POINT_copy |
438 | first appeared in OpenSSL 0.9.7 and have been available since | 171 | first appeared in OpenSSL 0.9.7 and have been available since |
439 | .Ox 3.2 . | 172 | .Ox 3.2 . |
440 | .Pp | 173 | .Pp |
441 | .Fn EC_POINT_dup , | 174 | .Fn EC_POINT_dup |
442 | .Fn EC_POINT_point2bn , | 175 | first appeared in OpenSSL 0.9.8 and has been available since |
443 | .Fn EC_POINT_bn2point , | ||
444 | .Fn EC_POINT_point2hex , | ||
445 | and | ||
446 | .Fn EC_POINT_hex2point | ||
447 | first appeared in OpenSSL 0.9.8 and have been available since | ||
448 | .Ox 4.5 . | 176 | .Ox 4.5 . |
449 | .Pp | 177 | .Sh BUGS |
450 | .Fn EC_POINT_set_affine_coordinates , | 178 | A fundamental flaw in the OpenSSL API toolkit is that |
451 | .Fn EC_POINT_get_affine_coordinates , | 179 | .Fn *_new |
180 | functions usually create invalid objects that are tricky to | ||
181 | turn into valid objects. | ||
182 | One specific flaw in the EC library internals is that | ||
183 | .Vt EC_POINT | ||
184 | objects do not hold a reference to the group they live on | ||
185 | despite the fact that | ||
186 | .Fn EC_POINT_new | ||
187 | has a | ||
188 | .Fa group | ||
189 | argument. | ||
190 | This is difficult to fix because | ||
191 | .Vt EC_GROUP | ||
192 | objects are not reference counted and | ||
193 | because of const qualifiers in the API. | ||
194 | This is the root cause for various contortions in the EC library | ||
195 | and API and | ||
196 | there are security implications because not | ||
197 | only does the library not know whether an | ||
198 | .Fa EC_POINT | ||
199 | object represents a valid point, | ||
200 | even if it did know that it would still not know on what curve. | ||
201 | .Pp | ||
202 | The signature of | ||
203 | .Fn EC_GROUP_dup | ||
204 | is bizarre and the order of | ||
205 | .Fa point | ||
452 | and | 206 | and |
453 | .Fn EC_POINT_set_compressed_coordinates | 207 | .Fa group |
454 | first appeared in OpenSSL 1.1.1 and have been available since | 208 | is inconsistent with the rest of the EC API. |
455 | .Ox 7.0 . | ||