summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man
diff options
context:
space:
mode:
authorschwarze <>2021-09-11 17:59:04 +0000
committerschwarze <>2021-09-11 17:59:04 +0000
commit99600028105f8346c63f71872e7feca71b9c776b (patch)
tree68a2ee83e71edead20e317114eea929c3033287f /src/lib/libcrypto/man
parent1860ad85c3edf296681b284d2b2dda4493dd9bd0 (diff)
downloadopenbsd-99600028105f8346c63f71872e7feca71b9c776b.tar.gz
openbsd-99600028105f8346c63f71872e7feca71b9c776b.tar.bz2
openbsd-99600028105f8346c63f71872e7feca71b9c776b.zip
Merge documentation of EC_GROUP_order_bits(3) from the OpenSSL 1.1.1
branch, which is still under a free license. While here, also merge a few other improvements, mostly regarding EC_GROUP_get_order(3) and EC_GROUP_get_cofactor(3); in particular, some statements below RETURN VALUES were outright wrong. This patch includes a few minor tweaks and an addition to HISTORY by me. Feedback and OK tb@.
Diffstat (limited to 'src/lib/libcrypto/man')
-rw-r--r--src/lib/libcrypto/man/EC_GROUP_copy.396
1 files changed, 70 insertions, 26 deletions
diff --git a/src/lib/libcrypto/man/EC_GROUP_copy.3 b/src/lib/libcrypto/man/EC_GROUP_copy.3
index bdbd72c2cc..a69017fa3e 100644
--- a/src/lib/libcrypto/man/EC_GROUP_copy.3
+++ b/src/lib/libcrypto/man/EC_GROUP_copy.3
@@ -1,8 +1,10 @@
1.\" $OpenBSD: EC_GROUP_copy.3,v 1.10 2018/03/23 23:18:17 schwarze Exp $ 1.\" $OpenBSD: EC_GROUP_copy.3,v 1.11 2021/09/11 17:59:04 schwarze Exp $
2.\" OpenSSL aafbe1cc Jun 12 23:42:08 2013 +0100 2.\" full merge up to: OpenSSL aafbe1cc Jun 12 23:42:08 2013 +0100
3.\" selective merge up to: OpenSSL 24c23e1f Aug 22 10:51:25 2019 +0530
3.\" 4.\"
4.\" This file was written by Matt Caswell <matt@openssl.org>. 5.\" This file was written by Matt Caswell <matt@openssl.org>
5.\" Copyright (c) 2013, 2015 The OpenSSL Project. All rights reserved. 6.\" and Jayaram X Matta <jayaramx.matta@intel.com>.
7.\" Copyright (c) 2013, 2015, 2019 The OpenSSL Project. All rights reserved.
6.\" 8.\"
7.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
@@ -48,7 +50,7 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 52.\"
51.Dd $Mdocdate: March 23 2018 $ 53.Dd $Mdocdate: September 11 2021 $
52.Dt EC_GROUP_COPY 3 54.Dt EC_GROUP_COPY 3
53.Os 55.Os
54.Sh NAME 56.Sh NAME
@@ -58,6 +60,7 @@
58.Nm EC_GROUP_set_generator , 60.Nm EC_GROUP_set_generator ,
59.Nm EC_GROUP_get0_generator , 61.Nm EC_GROUP_get0_generator ,
60.Nm EC_GROUP_get_order , 62.Nm EC_GROUP_get_order ,
63.Nm EC_GROUP_order_bits ,
61.Nm EC_GROUP_get_cofactor , 64.Nm EC_GROUP_get_cofactor ,
62.Nm EC_GROUP_set_curve_name , 65.Nm EC_GROUP_set_curve_name ,
63.Nm EC_GROUP_get_curve_name , 66.Nm EC_GROUP_get_curve_name ,
@@ -110,6 +113,10 @@
110.Fa "BN_CTX *ctx" 113.Fa "BN_CTX *ctx"
111.Fc 114.Fc
112.Ft int 115.Ft int
116.Fo EC_GROUP_order_bits
117.Fa "const EC_GROUP *group"
118.Fc
119.Ft int
113.Fo EC_GROUP_get_cofactor 120.Fo EC_GROUP_get_cofactor
114.Fa "const EC_GROUP *group" 121.Fa "const EC_GROUP *group"
115.Fa "BIGNUM *cofactor" 122.Fa "BIGNUM *cofactor"
@@ -250,16 +257,23 @@ gives the number of points on the curve.
250returns the generator for the identified 257returns the generator for the identified
251.Fa group . 258.Fa group .
252.Pp 259.Pp
253The functions
254.Fn EC_GROUP_get_order 260.Fn EC_GROUP_get_order
255and 261retrieves the order of the
262.Fa group
263and copies its value into
264.Fa order .
265It fails if the order of the
266.Fa group
267is not set or set to zero.
268.Pp
256.Fn EC_GROUP_get_cofactor 269.Fn EC_GROUP_get_cofactor
257populate the provided 270retrieves the cofactor of the
258.Fa order 271.Fa group
259and 272and copies its value into
260.Fa cofactor 273.Fa cofactor .
261parameters with the respective order and cofactors for the 274It fails if the cofactor of the
262.Fa group . 275.Fa group
276is not set or set to zero.
263.Pp 277.Pp
264The functions 278The functions
265.Fn EC_GROUP_set_curve_name 279.Fn EC_GROUP_set_curve_name
@@ -269,7 +283,8 @@ set and get the NID for the curve, respectively (see
269.Xr EC_GROUP_new 3 ) . 283.Xr EC_GROUP_new 3 ) .
270If a curve does not have a NID associated with it, then 284If a curve does not have a NID associated with it, then
271.Fn EC_GROUP_get_curve_name 285.Fn EC_GROUP_get_curve_name
272will return 0. 286will return
287.Dv NID_undef .
273.Pp 288.Pp
274The asn1_flag value on a curve is used to determine whether there is a 289The asn1_flag value on a curve is used to determine whether there is a
275specific ASN.1 OID to describe the curve or not. 290specific ASN.1 OID to describe the curve or not.
@@ -292,7 +307,7 @@ typedef enum {
292 /** the point is encoded as z||x, where the octet z specifies 307 /** the point is encoded as z||x, where the octet z specifies
293 * which solution of the quadratic equation y is */ 308 * which solution of the quadratic equation y is */
294 POINT_CONVERSION_COMPRESSED = 2, 309 POINT_CONVERSION_COMPRESSED = 2,
295 /** the point is encoded as z||x||y, where z is the octet 0x02 */ 310 /** the point is encoded as z||x||y, where z is the octet 0x04 */
296 POINT_CONVERSION_UNCOMPRESSED = 4, 311 POINT_CONVERSION_UNCOMPRESSED = 4,
297 /** the point is encoded as z||x||y, where the octet z specifies 312 /** the point is encoded as z||x||y, where the octet z specifies
298 * which solution of the quadratic equation y is */ 313 * which solution of the quadratic equation y is */
@@ -437,18 +452,43 @@ returns the generator for the given curve or
437.Dv NULL 452.Dv NULL
438on error. 453on error.
439.Pp 454.Pp
440.Fn EC_GROUP_get_order , 455.Fn EC_GROUP_get_order
441.Fn EC_GROUP_get_cofactor , 456returns 0 if the order is not set or set to zero for the
442.Fn EC_GROUP_get_curve_name , 457.Fa group
443.Fn EC_GROUP_get_asn1_flag , 458or if copying into
444.Fn EC_GROUP_get_point_conversion_form , 459.Fa order
445and 460fails, or 1 otherwise.
446.Fn EC_GROUP_get_degree 461.Pp
447return the order, cofactor, curve name (NID), ASN.1 flag, 462.Fn EC_GROUP_order_bits
448point_conversion_form and degree for the specified curve, respectively. 463returns the number of bits in the group order.
449If there is no curve name associated with a curve then 464.Pp
465.Fn EC_GROUP_get_cofactor
466returns 0 if the cofactor is not set or set to zero for the
467.Fa group
468or if copying into
469.Fa cofactor
470fails, or 1 otherwise.
471.Pp
450.Fn EC_GROUP_get_curve_name 472.Fn EC_GROUP_get_curve_name
451returns 0. 473returns the curve name (NID) for the
474.Fa group
475or
476.Dv NID_undef
477if no curve name is associated.
478.Pp
479.Fn EC_GROUP_get_asn1_flag
480returns the ASN.1 flag for the specified
481.Fa group .
482.Pp
483.Fn EC_GROUP_get_point_conversion_form
484returns the point_conversion_form for the
485.Fa group .
486.Pp
487.Fn EC_GROUP_get_degree
488returns the degree for the
489.Fa group
490or 0 if the operation is not supported
491by the underlying group implementation.
452.Pp 492.Pp
453.Fn EC_GROUP_get0_seed 493.Fn EC_GROUP_get0_seed
454returns a pointer to the seed that was used to generate the parameter 494returns a pointer to the seed that was used to generate the parameter
@@ -516,3 +556,7 @@ and
516.Fn EC_GROUP_get_pentanomial_basis 556.Fn EC_GROUP_get_pentanomial_basis
517first appeared in OpenSSL 0.9.8 and has been available since 557first appeared in OpenSSL 0.9.8 and has been available since
518.Ox 4.5 . 558.Ox 4.5 .
559.Pp
560.Fn EC_GROUP_order_bits
561first appeared in OpenSSL 1.1.0 and has been available since
562.Ox 7.0 .