summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec.h
diff options
context:
space:
mode:
authortb <>2023-04-25 19:53:30 +0000
committertb <>2023-04-25 19:53:30 +0000
commit82b040aef9cef17610a89204220ee3cb1012fb20 (patch)
treee9be44ea96c7294efcc800d9cb419edbab4fe999 /src/lib/libcrypto/ec/ec.h
parentaa0643f4294a31c69cf4097f866cd5cb11e48c1e (diff)
downloadopenbsd-82b040aef9cef17610a89204220ee3cb1012fb20.tar.gz
openbsd-82b040aef9cef17610a89204220ee3cb1012fb20.tar.bz2
openbsd-82b040aef9cef17610a89204220ee3cb1012fb20.zip
GF2m bites the dust. It won't be missed.
Diffstat (limited to 'src/lib/libcrypto/ec/ec.h')
-rw-r--r--src/lib/libcrypto/ec/ec.h87
1 files changed, 1 insertions, 86 deletions
diff --git a/src/lib/libcrypto/ec/ec.h b/src/lib/libcrypto/ec/ec.h
index a0dbbe6ce7..1afbe0ad16 100644
--- a/src/lib/libcrypto/ec/ec.h
+++ b/src/lib/libcrypto/ec/ec.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec.h,v 1.37 2023/04/25 19:28:22 tb Exp $ */ 1/* $OpenBSD: ec.h,v 1.38 2023/04/25 19:53:30 tb Exp $ */
2/* 2/*
3 * Originally written by Bodo Moeller for the OpenSSL project. 3 * Originally written by Bodo Moeller for the OpenSSL project.
4 */ 4 */
@@ -143,18 +143,6 @@ const EC_METHOD *EC_GFp_simple_method(void);
143 */ 143 */
144const EC_METHOD *EC_GFp_mont_method(void); 144const EC_METHOD *EC_GFp_mont_method(void);
145 145
146#ifndef OPENSSL_NO_EC2M
147/********************************************************************/
148/* EC_METHOD for curves over GF(2^m) */
149/********************************************************************/
150
151/** Returns the basic GF2m ec method
152 * \return EC_METHOD object
153 */
154const EC_METHOD *EC_GF2m_simple_method(void);
155
156#endif
157
158 146
159/********************************************************************/ 147/********************************************************************/
160/* EC_GROUP functions */ 148/* EC_GROUP functions */
@@ -284,28 +272,6 @@ int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, co
284 * \return 1 on success and 0 if an error occurred 272 * \return 1 on success and 0 if an error occurred
285 */ 273 */
286int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); 274int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
287
288#ifndef OPENSSL_NO_EC2M
289/** Sets the parameter of a ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b
290 * \param group EC_GROUP object
291 * \param p BIGNUM with the polynomial defining the underlying field
292 * \param a BIGNUM with parameter a of the equation
293 * \param b BIGNUM with parameter b of the equation
294 * \param ctx BN_CTX object (optional)
295 * \return 1 on success and 0 if an error occurred
296 */
297int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
298
299/** Gets the parameter of the ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b
300 * \param group EC_GROUP object
301 * \param p BIGNUM for the polynomial defining the underlying field
302 * \param a BIGNUM for parameter a of the equation
303 * \param b BIGNUM for parameter b of the equation
304 * \param ctx BN_CTX object (optional)
305 * \return 1 on success and 0 if an error occurred
306 */
307int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx);
308#endif
309#endif 275#endif
310 276
311/** Returns the number of bits needed to represent a field element 277/** Returns the number of bits needed to represent a field element
@@ -348,17 +314,6 @@ int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx);
348 * \return newly created EC_GROUP object with the specified parameters 314 * \return newly created EC_GROUP object with the specified parameters
349 */ 315 */
350EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); 316EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
351#ifndef OPENSSL_NO_EC2M
352/** Creates a new EC_GROUP object with the specified parameters defined
353 * over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b)
354 * \param p BIGNUM with the polynomial defining the underlying field
355 * \param a BIGNUM with the parameter a of the equation
356 * \param b BIGNUM with the parameter b of the equation
357 * \param ctx BN_CTX object (optional)
358 * \return newly created EC_GROUP object with the specified parameters
359 */
360EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
361#endif
362/** Creates a EC_GROUP object with a curve specified by a NID 317/** Creates a EC_GROUP object with a curve specified by a NID
363 * \param nid NID of the OID of the curve name 318 * \param nid NID of the OID of the curve name
364 * \return newly created EC_GROUP object with specified curve or NULL 319 * \return newly created EC_GROUP object with specified curve or NULL
@@ -507,41 +462,6 @@ int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
507 */ 462 */
508int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, 463int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
509 const BIGNUM *x, int y_bit, BN_CTX *ctx); 464 const BIGNUM *x, int y_bit, BN_CTX *ctx);
510
511#ifndef OPENSSL_NO_EC2M
512/** Sets the affine coordinates of a EC_POINT over GF2m
513 * \param group underlying EC_GROUP object
514 * \param p EC_POINT object
515 * \param x BIGNUM with the x-coordinate
516 * \param y BIGNUM with the y-coordinate
517 * \param ctx BN_CTX object (optional)
518 * \return 1 on success and 0 if an error occurred
519 */
520int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
521 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
522
523/** Gets the affine coordinates of a EC_POINT over GF2m
524 * \param group underlying EC_GROUP object
525 * \param p EC_POINT object
526 * \param x BIGNUM for the x-coordinate
527 * \param y BIGNUM for the y-coordinate
528 * \param ctx BN_CTX object (optional)
529 * \return 1 on success and 0 if an error occurred
530 */
531int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
532 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
533
534/** Sets the x9.62 compressed coordinates of a EC_POINT over GF2m
535 * \param group underlying EC_GROUP object
536 * \param p EC_POINT object
537 * \param x BIGNUM with x-coordinate
538 * \param y_bit integer with the y-Bit (either 0 or 1)
539 * \param ctx BN_CTX object (optional)
540 * \return 1 on success and 0 if an error occurred
541 */
542int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
543 const BIGNUM *x, int y_bit, BN_CTX *ctx);
544#endif /* OPENSSL_NO_EC2M */
545#endif /* !LIBRESSL_INTERNAL */ 465#endif /* !LIBRESSL_INTERNAL */
546 466
547/** Encodes a EC_POINT object to a octet string 467/** Encodes a EC_POINT object to a octet string
@@ -682,11 +602,6 @@ int EC_GROUP_have_precompute_mult(const EC_GROUP *group);
682/* EC_GROUP_get_basis_type() returns the NID of the basis type 602/* EC_GROUP_get_basis_type() returns the NID of the basis type
683 * used to represent the field elements */ 603 * used to represent the field elements */
684int EC_GROUP_get_basis_type(const EC_GROUP *); 604int EC_GROUP_get_basis_type(const EC_GROUP *);
685#ifndef OPENSSL_NO_EC2M
686int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);
687int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
688 unsigned int *k2, unsigned int *k3);
689#endif
690 605
691#define OPENSSL_EC_EXPLICIT_CURVE 0x000 606#define OPENSSL_EC_EXPLICIT_CURVE 0x000
692#define OPENSSL_EC_NAMED_CURVE 0x001 607#define OPENSSL_EC_NAMED_CURVE 0x001