summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec.h
diff options
context:
space:
mode:
authortb <>2021-04-20 17:32:57 +0000
committertb <>2021-04-20 17:32:57 +0000
commite3bdd39cc031d39a8ea071c9a8ecea5b6a958967 (patch)
treeb19c2d7871b27d3b2f6ce519613278cb8c4140a5 /src/lib/libcrypto/ec/ec.h
parent5ac32b17def2bf66d2e60cc7866c946a98c4a411 (diff)
downloadopenbsd-e3bdd39cc031d39a8ea071c9a8ecea5b6a958967.tar.gz
openbsd-e3bdd39cc031d39a8ea071c9a8ecea5b6a958967.tar.bz2
openbsd-e3bdd39cc031d39a8ea071c9a8ecea5b6a958967.zip
Prepare to provide EC_POINT_set_compressed_coordinates
ok jsing
Diffstat (limited to 'src/lib/libcrypto/ec/ec.h')
-rw-r--r--src/lib/libcrypto/ec/ec.h27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/lib/libcrypto/ec/ec.h b/src/lib/libcrypto/ec/ec.h
index ff60e80952..dece357d02 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.21 2021/04/20 17:28:18 tb Exp $ */ 1/* $OpenBSD: ec.h,v 1.22 2021/04/20 17:32:57 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 */
@@ -455,11 +455,20 @@ const EC_METHOD *EC_POINT_method_of(const EC_POINT *point);
455int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point); 455int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);
456 456
457#if defined(LIBRESSL_INTERNAL) 457#if defined(LIBRESSL_INTERNAL)
458
458int EC_POINT_set_Jprojective_coordinates(const EC_GROUP *group, EC_POINT *p, 459int EC_POINT_set_Jprojective_coordinates(const EC_GROUP *group, EC_POINT *p,
459 const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx); 460 const BIGNUM *x, const BIGNUM *y, const BIGNUM *z, BN_CTX *ctx);
460int EC_POINT_get_Jprojective_coordinates(const EC_GROUP *group, 461int EC_POINT_get_Jprojective_coordinates(const EC_GROUP *group,
461 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx); 462 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
463int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *p,
464 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
465int EC_POINT_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *p,
466 BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
467int EC_POINT_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *p,
468 const BIGNUM *x, int y_bit, BN_CTX *ctx);
469
462#else 470#else
471
463/** Sets the jacobian projective coordinates of a EC_POINT over GFp 472/** Sets the jacobian projective coordinates of a EC_POINT over GFp
464 * \param group underlying EC_GROUP object 473 * \param group underlying EC_GROUP object
465 * \param p EC_POINT object 474 * \param p EC_POINT object
@@ -483,14 +492,7 @@ int EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
483 */ 492 */
484int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group, 493int EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,
485 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx); 494 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
486#endif
487 495
488#if defined(LIBRESSL_INTERNAL)
489int EC_POINT_set_affine_coordinates(const EC_GROUP *group, EC_POINT *p,
490 const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx);
491int EC_POINT_get_affine_coordinates(const EC_GROUP *group, const EC_POINT *p,
492 BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
493#else
494/** Sets the affine coordinates of a EC_POINT over GFp 496/** Sets the affine coordinates of a EC_POINT over GFp
495 * \param group underlying EC_GROUP object 497 * \param group underlying EC_GROUP object
496 * \param p EC_POINT object 498 * \param p EC_POINT object
@@ -512,7 +514,6 @@ int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
512 */ 514 */
513int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, 515int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,
514 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); 516 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
515#endif
516 517
517/** Sets the x9.62 compressed coordinates of a EC_POINT over GFp 518/** Sets the x9.62 compressed coordinates of a EC_POINT over GFp
518 * \param group underlying EC_GROUP object 519 * \param group underlying EC_GROUP object
@@ -526,7 +527,6 @@ int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,
526 const BIGNUM *x, int y_bit, BN_CTX *ctx); 527 const BIGNUM *x, int y_bit, BN_CTX *ctx);
527 528
528#ifndef OPENSSL_NO_EC2M 529#ifndef OPENSSL_NO_EC2M
529#if !defined(LIBRESSL_INTERNAL)
530/** Sets the affine coordinates of a EC_POINT over GF2m 530/** Sets the affine coordinates of a EC_POINT over GF2m
531 * \param group underlying EC_GROUP object 531 * \param group underlying EC_GROUP object
532 * \param p EC_POINT object 532 * \param p EC_POINT object
@@ -548,7 +548,6 @@ int EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
548 */ 548 */
549int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group, 549int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
550 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx); 550 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BN_CTX *ctx);
551#endif
552 551
553/** Sets the x9.62 compressed coordinates of a EC_POINT over GF2m 552/** Sets the x9.62 compressed coordinates of a EC_POINT over GF2m
554 * \param group underlying EC_GROUP object 553 * \param group underlying EC_GROUP object
@@ -560,7 +559,9 @@ int EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,
560 */ 559 */
561int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p, 560int EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,
562 const BIGNUM *x, int y_bit, BN_CTX *ctx); 561 const BIGNUM *x, int y_bit, BN_CTX *ctx);
563#endif 562#endif /* OPENSSL_NO_EC2M */
563#endif /* !LIBRESSL_INTERNAL */
564
564/** Encodes a EC_POINT object to a octet string 565/** Encodes a EC_POINT object to a octet string
565 * \param group underlying EC_GROUP object 566 * \param group underlying EC_GROUP object
566 * \param p EC_POINT object 567 * \param p EC_POINT object