summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2023-07-03 07:26:40 +0000
committertb <>2023-07-03 07:26:40 +0000
commit7ff067a06a4219e0119ba4cfcadd91922b9696f7 (patch)
treeac34ce498be86f132bbd893725023c64f6fb490f /src
parent659aa2178d089822ccf693dbe92409198a5e6eba (diff)
downloadopenbsd-7ff067a06a4219e0119ba4cfcadd91922b9696f7.tar.gz
openbsd-7ff067a06a4219e0119ba4cfcadd91922b9696f7.tar.bz2
openbsd-7ff067a06a4219e0119ba4cfcadd91922b9696f7.zip
Provide internal-only EC_GROUP_get0_order()
ok jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/ec/ec_lib.c9
-rw-r--r--src/lib/libcrypto/ec/ec_local.h5
2 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c
index 2e180e9661..8cea0bb95b 100644
--- a/src/lib/libcrypto/ec/ec_lib.c
+++ b/src/lib/libcrypto/ec/ec_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_lib.c,v 1.61 2023/06/25 18:52:27 tb Exp $ */ 1/* $OpenBSD: ec_lib.c,v 1.62 2023/07/03 07:26:40 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 */
@@ -357,7 +357,6 @@ EC_GROUP_get0_generator(const EC_GROUP *group)
357 return group->generator; 357 return group->generator;
358} 358}
359 359
360
361int 360int
362EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) 361EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
363{ 362{
@@ -367,6 +366,12 @@ EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
367 return !BN_is_zero(order); 366 return !BN_is_zero(order);
368} 367}
369 368
369const BIGNUM *
370EC_GROUP_get0_order(const EC_GROUP *group)
371{
372 return &group->order;
373}
374
370int 375int
371EC_GROUP_order_bits(const EC_GROUP *group) 376EC_GROUP_order_bits(const EC_GROUP *group)
372{ 377{
diff --git a/src/lib/libcrypto/ec/ec_local.h b/src/lib/libcrypto/ec/ec_local.h
index a058878a69..0d219e8e21 100644
--- a/src/lib/libcrypto/ec/ec_local.h
+++ b/src/lib/libcrypto/ec/ec_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_local.h,v 1.22 2023/06/27 07:31:18 tb Exp $ */ 1/* $OpenBSD: ec_local.h,v 1.23 2023/07/03 07:26:40 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 */
@@ -360,4 +360,7 @@ int EC_POINT_set_Jprojective_coordinates(const EC_GROUP *group, EC_POINT *p,
360int EC_POINT_get_Jprojective_coordinates(const EC_GROUP *group, 360int EC_POINT_get_Jprojective_coordinates(const EC_GROUP *group,
361 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx); 361 const EC_POINT *p, BIGNUM *x, BIGNUM *y, BIGNUM *z, BN_CTX *ctx);
362 362
363/* Public API in OpenSSL */
364const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group);
365
363__END_HIDDEN_DECLS 366__END_HIDDEN_DECLS