summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec.h
diff options
context:
space:
mode:
authortb <>2021-04-20 17:16:38 +0000
committertb <>2021-04-20 17:16:38 +0000
commit67e97261c2453d56f2a373d1f3023d6538995dd5 (patch)
tree5887c8db20a9739a2d144ce6d009f6f18b6f49f1 /src/lib/libcrypto/ec/ec.h
parent3b87dc9794809a607c59f25dd5d25a8dd1b9e453 (diff)
downloadopenbsd-67e97261c2453d56f2a373d1f3023d6538995dd5.tar.gz
openbsd-67e97261c2453d56f2a373d1f3023d6538995dd5.tar.bz2
openbsd-67e97261c2453d56f2a373d1f3023d6538995dd5.zip
Prepare to provide EC_POINT_{g,s}et_affine_coordinates
Similar to part of OpenSSL commit 8e3cced75fb5fee5da59ebef9605d403a999391b ok jsing
Diffstat (limited to 'src/lib/libcrypto/ec/ec.h')
-rw-r--r--src/lib/libcrypto/ec/ec.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec.h b/src/lib/libcrypto/ec/ec.h
index a6ae3e3ac3..ebd80b91fd 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.19 2021/04/20 17:04:13 tb Exp $ */ 1/* $OpenBSD: ec.h,v 1.20 2021/04/20 17:16:37 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 */
@@ -478,6 +478,12 @@ int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
478int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, 478int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
479 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx); 479 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
480 480
481#if defined(LIBRESSL_INTERNAL)
482int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *p,
483 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
484int EC_POINT_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *p,
485 BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
486#else
481/** Sets the affine coordinates of a EC_POINT over GFp 487/** Sets the affine coordinates of a EC_POINT over GFp
482 * \param group underlying EC_GROUP object 488 * \param group underlying EC_GROUP object
483 * \param p EC_POINT object 489 * \param p EC_POINT object
@@ -499,6 +505,7 @@ int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
499 */ 505 */
500int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, 506int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
501 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); 507 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
508#endif
502 509
503/** Sets the x9.62 compressed coordinates of a EC_POINT over GFp 510/** Sets the x9.62 compressed coordinates of a EC_POINT over GFp
504 * \param group underlying EC_GROUP object 511 * \param group underlying EC_GROUP object
@@ -510,7 +517,9 @@ int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
510 */ 517 */
511int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p, 518int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
512 const BIGNUM *x, int y_bit, BN_CTX *ctx); 519 const BIGNUM *x, int y_bit, BN_CTX *ctx);
520
513#ifndef OPENSSL_NO_EC2M 521#ifndef OPENSSL_NO_EC2M
522#if !defined(LIBRESSL_INTERNAL)
514/** Sets the affine coordinates of a EC_POINT over GF2m 523/** Sets the affine coordinates of a EC_POINT over GF2m
515 * \param group underlying EC_GROUP object 524 * \param group underlying EC_GROUP object
516 * \param p EC_POINT object 525 * \param p EC_POINT object
@@ -532,6 +541,7 @@ int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
532 */ 541 */
533int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, 542int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
534 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); 543 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
544#endif
535 545
536/** Sets the x9.62 compressed coordinates of a EC_POINT over GF2m 546/** Sets the x9.62 compressed coordinates of a EC_POINT over GF2m
537 * \param group underlying EC_GROUP object 547 * \param group underlying EC_GROUP object