summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ecp_methods.c
diff options
context:
space:
mode:
authortb <>2025-01-01 09:57:02 +0000
committertb <>2025-01-01 09:57:02 +0000
commit183ebcd147bfd493e4856f28b1ff4c9c6dbd0730 (patch)
tree9af62a1a58881fed0768c163faef515fca142874 /src/lib/libcrypto/ec/ecp_methods.c
parent4f4db522b10347e779e635569d9938a60931b0d1 (diff)
downloadopenbsd-183ebcd147bfd493e4856f28b1ff4c9c6dbd0730.tar.gz
openbsd-183ebcd147bfd493e4856f28b1ff4c9c6dbd0730.tar.bz2
openbsd-183ebcd147bfd493e4856f28b1ff4c9c6dbd0730.zip
Garbage collect .group_init()
For both in-tree methods these are just complicated ways of zeroing part of the group object. The group is allocated with calloc(), so it's all entirely pointless. ok jsing
Diffstat (limited to 'src/lib/libcrypto/ec/ecp_methods.c')
-rw-r--r--src/lib/libcrypto/ec/ecp_methods.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/lib/libcrypto/ec/ecp_methods.c b/src/lib/libcrypto/ec/ecp_methods.c
index 591d895c58..333922d351 100644
--- a/src/lib/libcrypto/ec/ecp_methods.c
+++ b/src/lib/libcrypto/ec/ecp_methods.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecp_methods.c,v 1.15 2025/01/01 09:31:05 tb Exp $ */ 1/* $OpenBSD: ecp_methods.c,v 1.16 2025/01/01 09:57:02 tb Exp $ */
2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * for the OpenSSL project. 3 * for the OpenSSL project.
4 * Includes code written by Bodo Moeller for the OpenSSL project. 4 * Includes code written by Bodo Moeller for the OpenSSL project.
@@ -84,16 +84,6 @@
84 * representation (i.e. 'encoding' means multiplying by some factor R). 84 * representation (i.e. 'encoding' means multiplying by some factor R).
85 */ 85 */
86 86
87static int
88ec_group_init(EC_GROUP *group)
89{
90 BN_init(&group->p);
91 BN_init(&group->a);
92 BN_init(&group->b);
93 group->a_is_minus3 = 0;
94 return 1;
95}
96
97static void 87static void
98ec_group_finish(EC_GROUP *group) 88ec_group_finish(EC_GROUP *group)
99{ 89{
@@ -1536,17 +1526,6 @@ ec_mont_group_clear(EC_GROUP *group)
1536 group->mont_one = NULL; 1526 group->mont_one = NULL;
1537} 1527}
1538 1528
1539static int
1540ec_mont_group_init(EC_GROUP *group)
1541{
1542 int ok;
1543
1544 ok = ec_group_init(group);
1545 group->mont_ctx = NULL;
1546 group->mont_one = NULL;
1547 return ok;
1548}
1549
1550static void 1529static void
1551ec_mont_group_finish(EC_GROUP *group) 1530ec_mont_group_finish(EC_GROUP *group)
1552{ 1531{
@@ -1682,7 +1661,6 @@ ec_mont_field_set_to_one(const EC_GROUP *group, BIGNUM *r, BN_CTX *ctx)
1682 1661
1683static const EC_METHOD ec_GFp_simple_method = { 1662static const EC_METHOD ec_GFp_simple_method = {
1684 .field_type = NID_X9_62_prime_field, 1663 .field_type = NID_X9_62_prime_field,
1685 .group_init = ec_group_init,
1686 .group_finish = ec_group_finish, 1664 .group_finish = ec_group_finish,
1687 .group_copy = ec_group_copy, 1665 .group_copy = ec_group_copy,
1688 .group_set_curve = ec_group_set_curve, 1666 .group_set_curve = ec_group_set_curve,
@@ -1719,7 +1697,6 @@ LCRYPTO_ALIAS(EC_GFp_simple_method);
1719 1697
1720static const EC_METHOD ec_GFp_mont_method = { 1698static const EC_METHOD ec_GFp_mont_method = {
1721 .field_type = NID_X9_62_prime_field, 1699 .field_type = NID_X9_62_prime_field,
1722 .group_init = ec_mont_group_init,
1723 .group_finish = ec_mont_group_finish, 1700 .group_finish = ec_mont_group_finish,
1724 .group_copy = ec_mont_group_copy, 1701 .group_copy = ec_mont_group_copy,
1725 .group_set_curve = ec_mont_group_set_curve, 1702 .group_set_curve = ec_mont_group_set_curve,