diff options
author | tb <> | 2025-01-01 09:57:02 +0000 |
---|---|---|
committer | tb <> | 2025-01-01 09:57:02 +0000 |
commit | 183ebcd147bfd493e4856f28b1ff4c9c6dbd0730 (patch) | |
tree | 9af62a1a58881fed0768c163faef515fca142874 /src/lib/libcrypto/ec/ecp_methods.c | |
parent | 4f4db522b10347e779e635569d9938a60931b0d1 (diff) | |
download | openbsd-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.c | 25 |
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 | ||
87 | static int | ||
88 | ec_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 | |||
97 | static void | 87 | static void |
98 | ec_group_finish(EC_GROUP *group) | 88 | ec_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 | ||
1539 | static int | ||
1540 | ec_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 | |||
1550 | static void | 1529 | static void |
1551 | ec_mont_group_finish(EC_GROUP *group) | 1530 | ec_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 | ||
1683 | static const EC_METHOD ec_GFp_simple_method = { | 1662 | static 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 | ||
1720 | static const EC_METHOD ec_GFp_mont_method = { | 1698 | static 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, |