From 7ff067a06a4219e0119ba4cfcadd91922b9696f7 Mon Sep 17 00:00:00 2001 From: tb <> Date: Mon, 3 Jul 2023 07:26:40 +0000 Subject: Provide internal-only EC_GROUP_get0_order() ok jsing --- src/lib/libcrypto/ec/ec_lib.c | 9 +++++++-- src/lib/libcrypto/ec/ec_local.h | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src/lib/libcrypto') 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 @@ -/* $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/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 @@ -/* $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 -- cgit v1.2.3-55-g6feb