summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2023-04-27 09:35:20 +0000
committertb <>2023-04-27 09:35:20 +0000
commit269372ad3ec1b301ffbb459aedcbc2d4a196f4f9 (patch)
tree51342d8d3b5d34aff426c88b9ed034e226ba3c18 /src
parentaca9ca7e5f766a55f64c43f43d85f9cc43772ba4 (diff)
downloadopenbsd-269372ad3ec1b301ffbb459aedcbc2d4a196f4f9.tar.gz
openbsd-269372ad3ec1b301ffbb459aedcbc2d4a196f4f9.tar.bz2
openbsd-269372ad3ec1b301ffbb459aedcbc2d4a196f4f9.zip
EC_GROUP_new() Strip out complications due to binary curves.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/EC_GROUP_new.390
1 files changed, 11 insertions, 79 deletions
diff --git a/src/lib/libcrypto/man/EC_GROUP_new.3 b/src/lib/libcrypto/man/EC_GROUP_new.3
index ef7251fa3d..7a539eb92a 100644
--- a/src/lib/libcrypto/man/EC_GROUP_new.3
+++ b/src/lib/libcrypto/man/EC_GROUP_new.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: EC_GROUP_new.3,v 1.14 2022/03/31 17:27:16 naddy Exp $ 1.\" $OpenBSD: EC_GROUP_new.3,v 1.15 2023/04/27 09:35:20 tb Exp $
2.\" OpenSSL 6328d367 Sat Jul 4 21:58:30 2020 +0200 2.\" OpenSSL 6328d367 Sat Jul 4 21:58:30 2020 +0200
3.\" 3.\"
4.\" This file was written by Matt Caswell <matt@openssl.org>. 4.\" This file was written by Matt Caswell <matt@openssl.org>.
@@ -48,7 +48,7 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: March 31 2022 $ 51.Dd $Mdocdate: April 27 2023 $
52.Dt EC_GROUP_NEW 3 52.Dt EC_GROUP_NEW 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
@@ -56,14 +56,11 @@
56.Nm EC_GROUP_free , 56.Nm EC_GROUP_free ,
57.Nm EC_GROUP_clear_free , 57.Nm EC_GROUP_clear_free ,
58.Nm EC_GROUP_new_curve_GFp , 58.Nm EC_GROUP_new_curve_GFp ,
59.Nm EC_GROUP_new_curve_GF2m ,
60.Nm EC_GROUP_new_by_curve_name , 59.Nm EC_GROUP_new_by_curve_name ,
61.Nm EC_GROUP_set_curve , 60.Nm EC_GROUP_set_curve ,
62.Nm EC_GROUP_get_curve , 61.Nm EC_GROUP_get_curve ,
63.Nm EC_GROUP_set_curve_GFp , 62.Nm EC_GROUP_set_curve_GFp ,
64.Nm EC_GROUP_get_curve_GFp , 63.Nm EC_GROUP_get_curve_GFp ,
65.Nm EC_GROUP_set_curve_GF2m ,
66.Nm EC_GROUP_get_curve_GF2m ,
67.Nm EC_get_builtin_curves 64.Nm EC_get_builtin_curves
68.Nd create and destroy EC_GROUP objects 65.Nd create and destroy EC_GROUP objects
69.Sh SYNOPSIS 66.Sh SYNOPSIS
@@ -89,13 +86,6 @@
89.Fa "BN_CTX *ctx" 86.Fa "BN_CTX *ctx"
90.Fc 87.Fc
91.Ft EC_GROUP * 88.Ft EC_GROUP *
92.Fo EC_GROUP_new_curve_GF2m
93.Fa "const BIGNUM *p"
94.Fa "const BIGNUM *a"
95.Fa "const BIGNUM *b"
96.Fa "BN_CTX *ctx"
97.Fc
98.Ft EC_GROUP *
99.Fo EC_GROUP_new_by_curve_name 89.Fo EC_GROUP_new_by_curve_name
100.Fa "int nid" 90.Fa "int nid"
101.Fc 91.Fc
@@ -131,22 +121,6 @@
131.Fa "BIGNUM *b" 121.Fa "BIGNUM *b"
132.Fa "BN_CTX *ctx" 122.Fa "BN_CTX *ctx"
133.Fc 123.Fc
134.Ft int
135.Fo EC_GROUP_set_curve_GF2m
136.Fa "EC_GROUP *group"
137.Fa "const BIGNUM *p"
138.Fa "const BIGNUM *a"
139.Fa "const BIGNUM *b"
140.Fa "BN_CTX *ctx"
141.Fc
142.Ft int
143.Fo EC_GROUP_get_curve_GF2m
144.Fa "const EC_GROUP *group"
145.Fa "BIGNUM *p"
146.Fa "BIGNUM *a"
147.Fa "BIGNUM *b"
148.Fa "BN_CTX *ctx"
149.Fc
150.Ft size_t 124.Ft size_t
151.Fo EC_get_builtin_curves 125.Fo EC_get_builtin_curves
152.Fa "EC_builtin_curve *r" 126.Fa "EC_builtin_curve *r"
@@ -159,27 +133,6 @@ In general, an elliptic curve satisfies an equation of the form:
159.Pp 133.Pp
160.Dl y^2 = x^3 + ax + b 134.Dl y^2 = x^3 + ax + b
161.Pp 135.Pp
162Within the library there are two forms of elliptic curves that are of
163interest.
164The first form is those defined over the prime field Fp.
165The elements of Fp are the integers 0 to p-1, where
166.Fa p
167is a prime number.
168This gives us a revised elliptic curve equation as follows:
169.Pp
170.Dl y^2 mod p = x^3 + ax + b mod p
171.Pp
172The second form is those defined over a binary field F2^m where the
173elements of the field are integers of length at most m bits.
174For this form the elliptic curve equation is modified to:
175.Pp
176.Dl y^2 + xy = x^3 + ax^2 + b (where b != 0)
177.Pp
178Operations in a binary field are performed relative to an irreducible
179polynomial.
180All such curves with OpenSSL use a trinomial or a pentanomial for this
181parameter.
182.Pp
183An 136An
184.Vt EC_GROUP 137.Vt EC_GROUP
185structure is used to represent the definition of an elliptic curve. 138structure is used to represent the definition of an elliptic curve.
@@ -198,46 +151,30 @@ sets the curve parameters
198.Fa p , 151.Fa p ,
199.Fa a , 152.Fa a ,
200and 153and
201.Fa b . 154.Fa b ,
202For a curve over Fp, 155where
203.Fa p
204is the prime for the field.
205For a curve over F2^m
206.Fa p
207represents the irreducible polynomial - each bit represents a term in
208the polynomial.
209Therefore, there will either be three or five bits set dependent on
210whether the polynomial is a trinomial or a pentanomial.
211In either case,
212.Fa a 156.Fa a
213and 157and
214.Fa b 158.Fa b
215represent the coefficients of the curve equation. 159represent the coefficients of the curve equation.
216.Pp 160.Pp
217.Fn EC_GROUP_set_curve_GFp 161.Fn EC_GROUP_set_curve_GFp
218and 162is a deprecated synonym for
219.Fn EC_GROUP_set_curve_GF2m
220are deprecated synonyms for
221.Fn EC_GROUP_set_curve . 163.Fn EC_GROUP_set_curve .
222.Pp 164.Pp
223.Fn EC_GROUP_get_curve 165.Fn EC_GROUP_get_curve
224obtains the previously set curve parameters. 166obtains the previously set curve parameters.
225.Pp 167.Pp
226.Fn EC_GROUP_get_curve_GFp 168.Fn EC_GROUP_get_curve_GFp
227and 169is a deprecated synonym for
228.Fn EC_GROUP_get_curve_GF2m
229are deprecated synonyms for
230.Fn EC_GROUP_get_curve . 170.Fn EC_GROUP_get_curve .
231.Pp 171.Pp
232The functions 172The function
233.Fn EC_GROUP_new_curve_GFp 173.Fn EC_GROUP_new_curve_GFp
234and 174is a shortcut for calling
235.Fn EC_GROUP_new_curve_GF2m
236are shortcuts for calling
237.Fn EC_GROUP_new 175.Fn EC_GROUP_new
238and the appropriate 176and
239.Fn EC_GROUP_set_curve_* 177.Fn EC_GROUP_set_curve .
240function.
241An appropriate default implementation method will be used. 178An appropriate default implementation method will be used.
242.Pp 179.Pp
243Whilst the library can be used to create any curve using the functions 180Whilst the library can be used to create any curve using the functions
@@ -325,10 +262,8 @@ returns the number of builtin curves that are available.
325.Fn EC_GROUP_set_curve , 262.Fn EC_GROUP_set_curve ,
326.Fn EC_GROUP_get_curve , 263.Fn EC_GROUP_get_curve ,
327.Fn EC_GROUP_set_curve_GFp , 264.Fn EC_GROUP_set_curve_GFp ,
328.Fn EC_GROUP_get_curve_GFp ,
329.Fn EC_GROUP_set_curve_GF2m ,
330and 265and
331.Fn EC_GROUP_get_curve_GF2m 266.Fn EC_GROUP_get_curve_GFp
332return 1 on success or 0 on error. 267return 1 on success or 0 on error.
333.Sh SEE ALSO 268.Sh SEE ALSO
334.Xr crypto 3 , 269.Xr crypto 3 ,
@@ -351,10 +286,7 @@ and
351first appeared in OpenSSL 0.9.7 and have been available since 286first appeared in OpenSSL 0.9.7 and have been available since
352.Ox 3.2 . 287.Ox 3.2 .
353.Pp 288.Pp
354.Fn EC_GROUP_new_curve_GF2m ,
355.Fn EC_GROUP_new_by_curve_name , 289.Fn EC_GROUP_new_by_curve_name ,
356.Fn EC_GROUP_set_curve_GF2m ,
357.Fn EC_GROUP_get_curve_GF2m ,
358and 290and
359.Fn EC_get_builtin_curves 291.Fn EC_get_builtin_curves
360first appeared in OpenSSL 0.9.8 and have been available since 292first appeared in OpenSSL 0.9.8 and have been available since