diff options
| author | schwarze <> | 2021-09-11 17:59:04 +0000 |
|---|---|---|
| committer | schwarze <> | 2021-09-11 17:59:04 +0000 |
| commit | 6b26e78c6c668c2d81ebf87b49fe16389f658275 (patch) | |
| tree | 68a2ee83e71edead20e317114eea929c3033287f /src/lib/libcrypto/man | |
| parent | 08b230186e0fd125a82664490d49f98aeb69a858 (diff) | |
| download | openbsd-6b26e78c6c668c2d81ebf87b49fe16389f658275.tar.gz openbsd-6b26e78c6c668c2d81ebf87b49fe16389f658275.tar.bz2 openbsd-6b26e78c6c668c2d81ebf87b49fe16389f658275.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.3 | 96 |
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. | |||
| 250 | returns the generator for the identified | 257 | returns the generator for the identified |
| 251 | .Fa group . | 258 | .Fa group . |
| 252 | .Pp | 259 | .Pp |
| 253 | The functions | ||
| 254 | .Fn EC_GROUP_get_order | 260 | .Fn EC_GROUP_get_order |
| 255 | and | 261 | retrieves the order of the |
| 262 | .Fa group | ||
| 263 | and copies its value into | ||
| 264 | .Fa order . | ||
| 265 | It fails if the order of the | ||
| 266 | .Fa group | ||
| 267 | is not set or set to zero. | ||
| 268 | .Pp | ||
| 256 | .Fn EC_GROUP_get_cofactor | 269 | .Fn EC_GROUP_get_cofactor |
| 257 | populate the provided | 270 | retrieves the cofactor of the |
| 258 | .Fa order | 271 | .Fa group |
| 259 | and | 272 | and copies its value into |
| 260 | .Fa cofactor | 273 | .Fa cofactor . |
| 261 | parameters with the respective order and cofactors for the | 274 | It fails if the cofactor of the |
| 262 | .Fa group . | 275 | .Fa group |
| 276 | is not set or set to zero. | ||
| 263 | .Pp | 277 | .Pp |
| 264 | The functions | 278 | The 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 ) . |
| 270 | If a curve does not have a NID associated with it, then | 284 | If 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 |
| 272 | will return 0. | 286 | will return |
| 287 | .Dv NID_undef . | ||
| 273 | .Pp | 288 | .Pp |
| 274 | The asn1_flag value on a curve is used to determine whether there is a | 289 | The asn1_flag value on a curve is used to determine whether there is a |
| 275 | specific ASN.1 OID to describe the curve or not. | 290 | specific 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 |
| 438 | on error. | 453 | on error. |
| 439 | .Pp | 454 | .Pp |
| 440 | .Fn EC_GROUP_get_order , | 455 | .Fn EC_GROUP_get_order |
| 441 | .Fn EC_GROUP_get_cofactor , | 456 | returns 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 , | 458 | or if copying into |
| 444 | .Fn EC_GROUP_get_point_conversion_form , | 459 | .Fa order |
| 445 | and | 460 | fails, or 1 otherwise. |
| 446 | .Fn EC_GROUP_get_degree | 461 | .Pp |
| 447 | return the order, cofactor, curve name (NID), ASN.1 flag, | 462 | .Fn EC_GROUP_order_bits |
| 448 | point_conversion_form and degree for the specified curve, respectively. | 463 | returns the number of bits in the group order. |
| 449 | If there is no curve name associated with a curve then | 464 | .Pp |
| 465 | .Fn EC_GROUP_get_cofactor | ||
| 466 | returns 0 if the cofactor is not set or set to zero for the | ||
| 467 | .Fa group | ||
| 468 | or if copying into | ||
| 469 | .Fa cofactor | ||
| 470 | fails, or 1 otherwise. | ||
| 471 | .Pp | ||
| 450 | .Fn EC_GROUP_get_curve_name | 472 | .Fn EC_GROUP_get_curve_name |
| 451 | returns 0. | 473 | returns the curve name (NID) for the |
| 474 | .Fa group | ||
| 475 | or | ||
| 476 | .Dv NID_undef | ||
| 477 | if no curve name is associated. | ||
| 478 | .Pp | ||
| 479 | .Fn EC_GROUP_get_asn1_flag | ||
| 480 | returns the ASN.1 flag for the specified | ||
| 481 | .Fa group . | ||
| 482 | .Pp | ||
| 483 | .Fn EC_GROUP_get_point_conversion_form | ||
| 484 | returns the point_conversion_form for the | ||
| 485 | .Fa group . | ||
| 486 | .Pp | ||
| 487 | .Fn EC_GROUP_get_degree | ||
| 488 | returns the degree for the | ||
| 489 | .Fa group | ||
| 490 | or 0 if the operation is not supported | ||
| 491 | by the underlying group implementation. | ||
| 452 | .Pp | 492 | .Pp |
| 453 | .Fn EC_GROUP_get0_seed | 493 | .Fn EC_GROUP_get0_seed |
| 454 | returns a pointer to the seed that was used to generate the parameter | 494 | returns 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 |
| 517 | first appeared in OpenSSL 0.9.8 and has been available since | 557 | first 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 | ||
| 561 | first appeared in OpenSSL 1.1.0 and has been available since | ||
| 562 | .Ox 7.0 . | ||
