diff options
author | cvs2svn <admin@example.com> | 2025-04-14 17:32:06 +0000 |
---|---|---|
committer | cvs2svn <admin@example.com> | 2025-04-14 17:32:06 +0000 |
commit | eb8dd9dca1228af0cd132f515509051ecfabf6f6 (patch) | |
tree | edb6da6af7e865d488dc1a29309f1e1ec226e603 /src/lib/libcrypto/man/EC_POINT_new.3 | |
parent | 247f0352e0ed72a4f476db9dc91f4d982bc83eb2 (diff) | |
download | openbsd-tb_20250414.tar.gz openbsd-tb_20250414.tar.bz2 openbsd-tb_20250414.zip |
This commit was manufactured by cvs2git to create tag 'tb_20250414'.tb_20250414
Diffstat (limited to 'src/lib/libcrypto/man/EC_POINT_new.3')
-rw-r--r-- | src/lib/libcrypto/man/EC_POINT_new.3 | 455 |
1 files changed, 0 insertions, 455 deletions
diff --git a/src/lib/libcrypto/man/EC_POINT_new.3 b/src/lib/libcrypto/man/EC_POINT_new.3 deleted file mode 100644 index db6280fce7..0000000000 --- a/src/lib/libcrypto/man/EC_POINT_new.3 +++ /dev/null | |||
@@ -1,455 +0,0 @@ | |||
1 | .\" $OpenBSD: EC_POINT_new.3,v 1.17 2025/03/08 17:04:07 tb Exp $ | ||
2 | .\" full merge up to: OpenSSL 50db8163 Jul 30 16:56:41 2018 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Matt Caswell <matt@openssl.org>. | ||
5 | .\" Copyright (c) 2013, 2016 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
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 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm EC_POINT_new , | ||
56 | .Nm EC_POINT_free , | ||
57 | .Nm EC_POINT_clear_free , | ||
58 | .Nm EC_POINT_copy , | ||
59 | .Nm EC_POINT_dup , | ||
60 | .Nm EC_POINT_set_to_infinity , | ||
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 | ||
75 | .In openssl/ec.h | ||
76 | .In openssl/bn.h | ||
77 | .Ft EC_POINT * | ||
78 | .Fo EC_POINT_new | ||
79 | .Fa "const EC_GROUP *group" | ||
80 | .Fc | ||
81 | .Ft void | ||
82 | .Fo EC_POINT_free | ||
83 | .Fa "EC_POINT *point" | ||
84 | .Fc | ||
85 | .Ft void | ||
86 | .Fo EC_POINT_clear_free | ||
87 | .Fa "EC_POINT *point" | ||
88 | .Fc | ||
89 | .Ft int | ||
90 | .Fo EC_POINT_copy | ||
91 | .Fa "EC_POINT *dst" | ||
92 | .Fa "const EC_POINT *src" | ||
93 | .Fc | ||
94 | .Ft EC_POINT * | ||
95 | .Fo EC_POINT_dup | ||
96 | .Fa "const EC_POINT *src" | ||
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" | ||
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 | ||
198 | .Sh DESCRIPTION | ||
199 | An | ||
200 | .Vt EC_POINT | ||
201 | represents a point on a curve. | ||
202 | A curve is represented by an | ||
203 | .Vt EC_GROUP | ||
204 | object created by the functions described in | ||
205 | .Xr EC_GROUP_new 3 . | ||
206 | .Pp | ||
207 | A new point is constructed by calling the function | ||
208 | .Fn EC_POINT_new | ||
209 | and providing the | ||
210 | .Fa group | ||
211 | object that the point relates to. | ||
212 | .Pp | ||
213 | .Fn EC_POINT_free | ||
214 | frees the memory associated with the | ||
215 | .Vt EC_POINT . | ||
216 | If | ||
217 | .Fa point | ||
218 | is a | ||
219 | .Dv NULL | ||
220 | pointer, no action occurs. | ||
221 | .Pp | ||
222 | .Fn EC_POINT_clear_free | ||
223 | destroys any sensitive data held within the | ||
224 | .Vt EC_POINT | ||
225 | and then frees its memory. | ||
226 | If | ||
227 | .Fa point | ||
228 | is a | ||
229 | .Dv NULL | ||
230 | pointer, no action occurs. | ||
231 | .Pp | ||
232 | .Fn EC_POINT_copy | ||
233 | copies the point | ||
234 | .Fa src | ||
235 | into | ||
236 | .Fa dst . | ||
237 | Both | ||
238 | .Fa src | ||
239 | and | ||
240 | .Fa dst | ||
241 | must use the same | ||
242 | .Vt EC_METHOD . | ||
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 | ||
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 | ||
260 | .Fa y | ||
261 | position. | ||
262 | The function | ||
263 | .Fn EC_POINT_set_affine_coordinates | ||
264 | sets the | ||
265 | .Fa x | ||
266 | and | ||
267 | .Fa y | ||
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 | ||
363 | The function | ||
364 | .Fn EC_POINT_point2hex | ||
365 | will allocate sufficient memory to store the hexadecimal string. | ||
366 | It is the caller's responsibility to free this memory with a subsequent | ||
367 | call to | ||
368 | .Xr free 3 . | ||
369 | .Sh RETURN VALUES | ||
370 | .Fn EC_POINT_new | ||
371 | and | ||
372 | .Fn EC_POINT_dup | ||
373 | return the newly allocated | ||
374 | .Vt EC_POINT | ||
375 | or | ||
376 | .Dv NULL | ||
377 | on error. | ||
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 | ||
401 | .Fn EC_POINT_bn2point | ||
402 | returns the pointer to the | ||
403 | .Vt EC_POINT | ||
404 | supplied or | ||
405 | .Dv NULL | ||
406 | on error. | ||
407 | .Pp | ||
408 | .Fn EC_POINT_point2hex | ||
409 | returns a pointer to the hex string or | ||
410 | .Dv NULL | ||
411 | on error. | ||
412 | .Pp | ||
413 | .Fn EC_POINT_hex2point | ||
414 | returns the pointer to the | ||
415 | .Vt EC_POINT | ||
416 | supplied or | ||
417 | .Dv NULL | ||
418 | on error. | ||
419 | .Sh SEE ALSO | ||
420 | .Xr d2i_ECPKParameters 3 , | ||
421 | .Xr EC_GROUP_copy 3 , | ||
422 | .Xr EC_GROUP_new 3 , | ||
423 | .Xr EC_KEY_new 3 , | ||
424 | .Xr EC_POINT_add 3 , | ||
425 | .Xr ECDH_compute_key 3 | ||
426 | .Sh HISTORY | ||
427 | .Fn EC_POINT_new , | ||
428 | .Fn EC_POINT_free , | ||
429 | .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 | ||
437 | .Fn EC_POINT_oct2point | ||
438 | first appeared in OpenSSL 0.9.7 and have been available since | ||
439 | .Ox 3.2 . | ||
440 | .Pp | ||
441 | .Fn EC_POINT_dup , | ||
442 | .Fn EC_POINT_point2bn , | ||
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 . | ||
449 | .Pp | ||
450 | .Fn EC_POINT_set_affine_coordinates , | ||
451 | .Fn EC_POINT_get_affine_coordinates , | ||
452 | and | ||
453 | .Fn EC_POINT_set_compressed_coordinates | ||
454 | first appeared in OpenSSL 1.1.1 and have been available since | ||
455 | .Ox 7.0 . | ||