summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ec_lib.c')
-rw-r--r--src/lib/libcrypto/ec/ec_lib.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c
index e763e6b70c..994fd2d4c1 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.39 2021/04/20 17:29:21 tb Exp $ */ 1/* $OpenBSD: ec_lib.c,v 1.40 2021/09/08 17:29:21 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 */
@@ -401,6 +401,11 @@ EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx)
401 return !BN_is_zero(order); 401 return !BN_is_zero(order);
402} 402}
403 403
404int
405EC_GROUP_order_bits(const EC_GROUP *group)
406{
407 return group->meth->group_order_bits(group);
408}
404 409
405int 410int
406EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx) 411EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx)
@@ -1261,6 +1266,17 @@ EC_GROUP_have_precompute_mult(const EC_GROUP * group)
1261 * been performed */ 1266 * been performed */
1262} 1267}
1263 1268
1269int
1270ec_group_simple_order_bits(const EC_GROUP *group)
1271{
1272 /* XXX change group->order to a pointer? */
1273#if 0
1274 if (group->order == NULL)
1275 return 0;
1276#endif
1277 return BN_num_bits(&group->order);
1278}
1279
1264EC_KEY * 1280EC_KEY *
1265ECParameters_dup(EC_KEY *key) 1281ECParameters_dup(EC_KEY *key)
1266{ 1282{