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.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c
index 11d09b65cd..0e5897da9d 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.69 2024/10/15 17:44:43 tb Exp $ */ 1/* $OpenBSD: ec_lib.c,v 1.70 2024/10/18 10:57:26 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 */
@@ -544,6 +544,27 @@ EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b,
544} 544}
545LCRYPTO_ALIAS(EC_GROUP_get_curve_GFp); 545LCRYPTO_ALIAS(EC_GROUP_get_curve_GFp);
546 546
547EC_GROUP *
548EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b,
549 BN_CTX *ctx)
550{
551 EC_GROUP *group;
552
553 if ((group = EC_GROUP_new(EC_GFp_mont_method())) == NULL)
554 goto err;
555
556 if (!EC_GROUP_set_curve(group, p, a, b, ctx))
557 goto err;
558
559 return group;
560
561 err:
562 EC_GROUP_free(group);
563
564 return NULL;
565}
566LCRYPTO_ALIAS(EC_GROUP_new_curve_GFp);
567
547int 568int
548EC_GROUP_get_degree(const EC_GROUP *group) 569EC_GROUP_get_degree(const EC_GROUP *group)
549{ 570{