summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-07-03 07:26:41 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-07-03 07:26:41 +0000
commit3170ddad3a354f49c3015007db734751ad897099 (patch)
tree340eb79fef7186f6533fc696490196d18fa09513 /lib
parenta46686b4fde30a9b3d062bf9591edbbeac94172e (diff)
Provide internal-only EC_GROUP_get0_order()
ok jsing
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/ec/ec_lib.c9
-rw-r--r--lib/libcrypto/ec/ec_local.h5
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/libcrypto/ec/ec_lib.c b/lib/libcrypto/ec/ec_lib.c
index 2e180e96618..8cea0bb95bf 100644
--- a/lib/libcrypto/ec/ec_lib.c
+++ b/lib/libcrypto/ec/ec_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec_lib.c,v 1.61 2023/06/25 18:52:27 tb Exp $ */
+/* $OpenBSD: ec_lib.c,v 1.62 2023/07/03 07:26:40 tb Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
@@ -357,7 +357,6 @@ EC_GROUP_get0_generator(const EC_GROUP *group)
return group->generator;
}
-
int
EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
{
@@ -367,6 +366,12 @@ EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
return !BN_is_zero(order);
}
+const BIGNUM *
+EC_GROUP_get0_order(const EC_GROUP *group)
+{
+ return &group->order;
+}
+
int
EC_GROUP_order_bits(const EC_GROUP *group)
{
diff --git a/lib/libcrypto/ec/ec_local.h b/lib/libcrypto/ec/ec_local.h
index a058878a696..0d219e8e214 100644
--- a/lib/libcrypto/ec/ec_local.h
+++ b/lib/libcrypto/ec/ec_local.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec_local.h,v 1.22 2023/06/27 07:31:18 tb Exp $ */
+/* $OpenBSD: ec_local.h,v 1.23 2023/07/03 07:26:40 tb Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
@@ -360,4 +360,7 @@ int EC_POINT_set_Jprojective_coordinates(const EC_GROUP *group, EC_POINT *p,
int EC_POINT_get_Jprojective_coordinates(const EC_GROUP *group,
const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
+/* Public API in OpenSSL */
+const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group);
+
__END_HIDDEN_DECLS