From: tb Date: Thu, 27 Apr 2023 09:35:20 +0000 (+0000) Subject: EC_GROUP_new() Strip out complications due to binary curves. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7b4b8eb1d75bf65d1597ed784e02fef7d6851ec2;p=openbsd EC_GROUP_new() Strip out complications due to binary curves. --- diff --git a/lib/libcrypto/man/EC_GROUP_new.3 b/lib/libcrypto/man/EC_GROUP_new.3 index ef7251fa3d4..7a539eb92ac 100644 --- a/lib/libcrypto/man/EC_GROUP_new.3 +++ b/lib/libcrypto/man/EC_GROUP_new.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: EC_GROUP_new.3,v 1.14 2022/03/31 17:27:16 naddy Exp $ +.\" $OpenBSD: EC_GROUP_new.3,v 1.15 2023/04/27 09:35:20 tb Exp $ .\" OpenSSL 6328d367 Sat Jul 4 21:58:30 2020 +0200 .\" .\" This file was written by Matt Caswell . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 31 2022 $ +.Dd $Mdocdate: April 27 2023 $ .Dt EC_GROUP_NEW 3 .Os .Sh NAME @@ -56,14 +56,11 @@ .Nm EC_GROUP_free , .Nm EC_GROUP_clear_free , .Nm EC_GROUP_new_curve_GFp , -.Nm EC_GROUP_new_curve_GF2m , .Nm EC_GROUP_new_by_curve_name , .Nm EC_GROUP_set_curve , .Nm EC_GROUP_get_curve , .Nm EC_GROUP_set_curve_GFp , .Nm EC_GROUP_get_curve_GFp , -.Nm EC_GROUP_set_curve_GF2m , -.Nm EC_GROUP_get_curve_GF2m , .Nm EC_get_builtin_curves .Nd create and destroy EC_GROUP objects .Sh SYNOPSIS @@ -89,13 +86,6 @@ .Fa "BN_CTX *ctx" .Fc .Ft EC_GROUP * -.Fo EC_GROUP_new_curve_GF2m -.Fa "const BIGNUM *p" -.Fa "const BIGNUM *a" -.Fa "const BIGNUM *b" -.Fa "BN_CTX *ctx" -.Fc -.Ft EC_GROUP * .Fo EC_GROUP_new_by_curve_name .Fa "int nid" .Fc @@ -131,22 +121,6 @@ .Fa "BIGNUM *b" .Fa "BN_CTX *ctx" .Fc -.Ft int -.Fo EC_GROUP_set_curve_GF2m -.Fa "EC_GROUP *group" -.Fa "const BIGNUM *p" -.Fa "const BIGNUM *a" -.Fa "const BIGNUM *b" -.Fa "BN_CTX *ctx" -.Fc -.Ft int -.Fo EC_GROUP_get_curve_GF2m -.Fa "const EC_GROUP *group" -.Fa "BIGNUM *p" -.Fa "BIGNUM *a" -.Fa "BIGNUM *b" -.Fa "BN_CTX *ctx" -.Fc .Ft size_t .Fo EC_get_builtin_curves .Fa "EC_builtin_curve *r" @@ -159,27 +133,6 @@ In general, an elliptic curve satisfies an equation of the form: .Pp .Dl y^2 = x^3 + ax + b .Pp -Within the library there are two forms of elliptic curves that are of -interest. -The first form is those defined over the prime field Fp. -The elements of Fp are the integers 0 to p-1, where -.Fa p -is a prime number. -This gives us a revised elliptic curve equation as follows: -.Pp -.Dl y^2 mod p = x^3 + ax + b mod p -.Pp -The second form is those defined over a binary field F2^m where the -elements of the field are integers of length at most m bits. -For this form the elliptic curve equation is modified to: -.Pp -.Dl y^2 + xy = x^3 + ax^2 + b (where b != 0) -.Pp -Operations in a binary field are performed relative to an irreducible -polynomial. -All such curves with OpenSSL use a trinomial or a pentanomial for this -parameter. -.Pp An .Vt EC_GROUP structure is used to represent the definition of an elliptic curve. @@ -198,46 +151,30 @@ sets the curve parameters .Fa p , .Fa a , and -.Fa b . -For a curve over Fp, -.Fa p -is the prime for the field. -For a curve over F2^m -.Fa p -represents the irreducible polynomial - each bit represents a term in -the polynomial. -Therefore, there will either be three or five bits set dependent on -whether the polynomial is a trinomial or a pentanomial. -In either case, +.Fa b , +where .Fa a and .Fa b represent the coefficients of the curve equation. .Pp .Fn EC_GROUP_set_curve_GFp -and -.Fn EC_GROUP_set_curve_GF2m -are deprecated synonyms for +is a deprecated synonym for .Fn EC_GROUP_set_curve . .Pp .Fn EC_GROUP_get_curve obtains the previously set curve parameters. .Pp .Fn EC_GROUP_get_curve_GFp -and -.Fn EC_GROUP_get_curve_GF2m -are deprecated synonyms for +is a deprecated synonym for .Fn EC_GROUP_get_curve . .Pp -The functions +The function .Fn EC_GROUP_new_curve_GFp -and -.Fn EC_GROUP_new_curve_GF2m -are shortcuts for calling +is a shortcut for calling .Fn EC_GROUP_new -and the appropriate -.Fn EC_GROUP_set_curve_* -function. +and +.Fn EC_GROUP_set_curve . An appropriate default implementation method will be used. .Pp Whilst 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. .Fn EC_GROUP_set_curve , .Fn EC_GROUP_get_curve , .Fn EC_GROUP_set_curve_GFp , -.Fn EC_GROUP_get_curve_GFp , -.Fn EC_GROUP_set_curve_GF2m , and -.Fn EC_GROUP_get_curve_GF2m +.Fn EC_GROUP_get_curve_GFp return 1 on success or 0 on error. .Sh SEE ALSO .Xr crypto 3 , @@ -351,10 +286,7 @@ and first appeared in OpenSSL 0.9.7 and have been available since .Ox 3.2 . .Pp -.Fn EC_GROUP_new_curve_GF2m , .Fn EC_GROUP_new_by_curve_name , -.Fn EC_GROUP_set_curve_GF2m , -.Fn EC_GROUP_get_curve_GF2m , and .Fn EC_get_builtin_curves first appeared in OpenSSL 0.9.8 and have been available since