diff options
Diffstat (limited to 'src/lib/libcrypto/man/EC_POINT_get_affine_coordinates.3')
-rw-r--r-- | src/lib/libcrypto/man/EC_POINT_get_affine_coordinates.3 | 216 |
1 files changed, 216 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/EC_POINT_get_affine_coordinates.3 b/src/lib/libcrypto/man/EC_POINT_get_affine_coordinates.3 new file mode 100644 index 0000000000..76ef516307 --- /dev/null +++ b/src/lib/libcrypto/man/EC_POINT_get_affine_coordinates.3 | |||
@@ -0,0 +1,216 @@ | |||
1 | .\" $OpenBSD: EC_POINT_get_affine_coordinates.3,v 1.2 2025/06/08 22:40:29 schwarze Exp $ | ||
2 | .\" | ||
3 | .\" Copyright (c) 2025 Theo Buehler <tb@openbsd.org> | ||
4 | .\" | ||
5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
7 | .\" copyright notice and this permission notice appear in all copies. | ||
8 | .\" | ||
9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
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. | ||
16 | .\" | ||
17 | .Dd $Mdocdate: June 8 2025 $ | ||
18 | .Dt EC_POINT_GET_AFFINE_COORDINATES 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm EC_POINT_get_affine_coordinates , | ||
22 | .Nm EC_POINT_set_affine_coordinates , | ||
23 | .Nm EC_POINT_set_compressed_coordinates , | ||
24 | .Nm EC_POINT_set_to_infinity , | ||
25 | .Nm EC_POINT_get_affine_coordinates_GFp , | ||
26 | .Nm EC_POINT_set_affine_coordinates_GFp , | ||
27 | .Nm EC_POINT_set_compressed_coordinates_GFp | ||
28 | .Nd get and set coordinates of elliptic curve points | ||
29 | .Sh SYNOPSIS | ||
30 | .Lb libcrypto | ||
31 | .In openssl/bn.h | ||
32 | .In openssl/ec.h | ||
33 | .Pp | ||
34 | .Ft int | ||
35 | .Fo EC_POINT_get_affine_coordinates | ||
36 | .Fa "const EC_GROUP *group" | ||
37 | .Fa "const EC_POINT *point" | ||
38 | .Fa "BIGNUM *x" | ||
39 | .Fa "BIGNUM *y" | ||
40 | .Fa "BN_CTX *ctx" | ||
41 | .Fc | ||
42 | .Ft int | ||
43 | .Fo EC_POINT_set_affine_coordinates | ||
44 | .Fa "const EC_GROUP *group" | ||
45 | .Fa "EC_POINT *point" | ||
46 | .Fa "const BIGNUM *x" | ||
47 | .Fa "const BIGNUM *y" | ||
48 | .Fa "BN_CTX *ctx" | ||
49 | .Fc | ||
50 | .Ft int | ||
51 | .Fo EC_POINT_set_compressed_coordinates | ||
52 | .Fa "const EC_GROUP *group" | ||
53 | .Fa "EC_POINT *point" | ||
54 | .Fa "const BIGNUM *x" | ||
55 | .Fa "int y_bit" | ||
56 | .Fa "BN_CTX *ctx" | ||
57 | .Fc | ||
58 | .Ft int | ||
59 | .Fo EC_POINT_set_to_infinity | ||
60 | .Fa "const EC_GROUP *group" | ||
61 | .Fa "EC_POINT *point" | ||
62 | .Fc | ||
63 | .Pp | ||
64 | Deprecated: | ||
65 | .Pp | ||
66 | .Ft int | ||
67 | .Fo EC_POINT_get_affine_coordinates_GFp | ||
68 | .Fa "const EC_GROUP *group" | ||
69 | .Fa "const EC_POINT *point" | ||
70 | .Fa "BIGNUM *x" | ||
71 | .Fa "BIGNUM *y" | ||
72 | .Fa "BN_CTX *ctx" | ||
73 | .Fc | ||
74 | .Ft int | ||
75 | .Fo EC_POINT_set_affine_coordinates_GFp | ||
76 | .Fa "const EC_GROUP *group" | ||
77 | .Fa "EC_POINT *point" | ||
78 | .Fa "const BIGNUM *x" | ||
79 | .Fa "const BIGNUM *y" | ||
80 | .Fa "BN_CTX *ctx" | ||
81 | .Fc | ||
82 | .Ft int | ||
83 | .Fo EC_POINT_set_compressed_coordinates_GFp | ||
84 | .Fa "const EC_GROUP *group" | ||
85 | .Fa "EC_POINT *point" | ||
86 | .Fa "const BIGNUM *x" | ||
87 | .Fa "int y_bit" | ||
88 | .Fa "BN_CTX *ctx" | ||
89 | .Fc | ||
90 | .Sh DESCRIPTION | ||
91 | .Fn EC_POINT_get_affine_coordinates | ||
92 | assumes that | ||
93 | .Fa point | ||
94 | is a point on | ||
95 | .Fa group , | ||
96 | calculates its affine coordinates from its internal representation | ||
97 | using the optional | ||
98 | .Fa ctx , | ||
99 | and copies them into the optional user-provided | ||
100 | .Fa x | ||
101 | and | ||
102 | .Fa y . | ||
103 | .Pp | ||
104 | .Fn EC_POINT_set_affine_coordinates | ||
105 | assumes that | ||
106 | .Fa x | ||
107 | and | ||
108 | .Fa y | ||
109 | are the affine coordinates of a point on | ||
110 | .Fa group , | ||
111 | converts them into internal representation and sets them on | ||
112 | .Fa point | ||
113 | using the optional | ||
114 | .Fa ctx . | ||
115 | The user-provided | ||
116 | .Fa point | ||
117 | should be the result of | ||
118 | .Fn EC_POINT_new 3 | ||
119 | with an argument of | ||
120 | .Fa group . | ||
121 | It then verifies using | ||
122 | .Xr EC_POINT_is_on_curve 3 | ||
123 | that | ||
124 | .Fa x | ||
125 | and | ||
126 | .Fa y | ||
127 | are indeed the affine coordinates of a point on | ||
128 | .Fa group . | ||
129 | .Pp | ||
130 | .Fn EC_POINT_set_compressed_coordinates | ||
131 | assumes that | ||
132 | .Fa x | ||
133 | is the x-coordinate and | ||
134 | .Fa y_bit | ||
135 | is the parity bit of a point on | ||
136 | .Fa group | ||
137 | and sets | ||
138 | .Fa point | ||
139 | to the corresponding point on | ||
140 | .Fa group . | ||
141 | It does this by solving the quadratic equation y^2 = x^3 + ax + b using | ||
142 | .Xr BN_mod_sqrt 3 | ||
143 | and the optional | ||
144 | .Fa ctx , | ||
145 | chooses the solution | ||
146 | .Fa y | ||
147 | with parity matching | ||
148 | .Fa y_bit , | ||
149 | and passes | ||
150 | .Fa x | ||
151 | and | ||
152 | .Fa y | ||
153 | to | ||
154 | .Fn EC_POINT_set_affine_coordinates . | ||
155 | The user-provided | ||
156 | .Fa point | ||
157 | should be the result of | ||
158 | .Fn EC_POINT_new | ||
159 | with argument | ||
160 | .Fa group . | ||
161 | .Pp | ||
162 | .Fn EC_POINT_set_to_infinity | ||
163 | sets | ||
164 | .Fa point | ||
165 | to the internal representation of the point at infinity on | ||
166 | .Fa group . | ||
167 | .Pp | ||
168 | .Fn EC_POINT_get_affine_coordinates_GFp | ||
169 | is a deprecated alias for | ||
170 | .Fn EC_POINT_get_affine_coordinates . | ||
171 | Similarly for | ||
172 | .Fn EC_POINT_set_affine_coordinates_GFp | ||
173 | and | ||
174 | .Fn EC_POINT_set_compressed_coordinates_GFp . | ||
175 | .Sh RETURN VALUES | ||
176 | All these functions return 1 on success and 0 on error. | ||
177 | Error conditions include memory allocation failure, | ||
178 | that | ||
179 | .Fa point | ||
180 | is incompatible with | ||
181 | .Fa group , | ||
182 | and, for the coordinate setters, that the provided coordinates | ||
183 | do not represent a point on | ||
184 | .Fa group . | ||
185 | .Sh SEE ALSO | ||
186 | .Xr BN_CTX_new 3 , | ||
187 | .Xr BN_is_zero 3 , | ||
188 | .Xr BN_mod_sqrt 3 , | ||
189 | .Xr crypto 3 , | ||
190 | .Xr d2i_ECPKParameters 3 , | ||
191 | .Xr EC_GROUP_check 3 , | ||
192 | .Xr EC_GROUP_get_curve_name 3 , | ||
193 | .Xr EC_GROUP_new_by_curve_name 3 , | ||
194 | .Xr EC_GROUP_new_curve_GFp 3 , | ||
195 | .Xr EC_KEY_METHOD_new 3 , | ||
196 | .Xr EC_KEY_new 3 , | ||
197 | .Xr EC_POINT_add 3 , | ||
198 | .Xr EC_POINT_new 3 , | ||
199 | .Xr EC_POINT_point2oct 3 , | ||
200 | .Xr ECDH_compute_key 3 , | ||
201 | .Xr ECDSA_SIG_new 3 | ||
202 | .Sh HISTORY | ||
203 | .Fn EC_POINT_get_affine_coordinates_GFp , | ||
204 | .Fn EC_POINT_set_affine_coordinates_GFp , | ||
205 | .Fn EC_POINT_set_compressed_coordinates_GFp , | ||
206 | and | ||
207 | .Fn EC_POINT_set_to_infinity | ||
208 | first appeared in OpenSSL 0.9.7 and have been available since | ||
209 | .Ox 3.2 . | ||
210 | .Pp | ||
211 | .Fn EC_POINT_get_affine_coordinates , | ||
212 | .Fn EC_POINT_set_affine_coordinates , | ||
213 | and | ||
214 | .Fn EC_POINT_set_compressed_coordinates | ||
215 | first appeared in OpenSSL 1.1.1 and have been available since | ||
216 | .Ox 7.0 . | ||