summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec2_smpl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ec2_smpl.c')
-rw-r--r--src/lib/libcrypto/ec/ec2_smpl.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/src/lib/libcrypto/ec/ec2_smpl.c b/src/lib/libcrypto/ec/ec2_smpl.c
index f995ff8718..84cba1b83b 100644
--- a/src/lib/libcrypto/ec/ec2_smpl.c
+++ b/src/lib/libcrypto/ec/ec2_smpl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec2_smpl.c,v 1.32 2023/03/08 04:50:27 jsing Exp $ */ 1/* $OpenBSD: ec2_smpl.c,v 1.33 2023/03/08 05:45:31 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -89,7 +89,7 @@ ec_GF2m_simple_group_init(EC_GROUP *group)
89} 89}
90 90
91/* 91/*
92 * Free a GF(2^m)-based EC_GROUP structure. 92 * Clear and free a GF(2^m)-based EC_GROUP structure.
93 * Note that all other members are handled by EC_GROUP_free. 93 * Note that all other members are handled by EC_GROUP_free.
94 */ 94 */
95static void 95static void
@@ -98,18 +98,6 @@ ec_GF2m_simple_group_finish(EC_GROUP *group)
98 BN_free(&group->field); 98 BN_free(&group->field);
99 BN_free(&group->a); 99 BN_free(&group->a);
100 BN_free(&group->b); 100 BN_free(&group->b);
101}
102
103/*
104 * Clear and free a GF(2^m)-based EC_GROUP structure.
105 * Note that all other members are handled by EC_GROUP_clear_free.
106 */
107static void
108ec_GF2m_simple_group_clear_finish(EC_GROUP *group)
109{
110 BN_free(&group->field);
111 BN_free(&group->a);
112 BN_free(&group->b);
113 group->poly[0] = 0; 101 group->poly[0] = 0;
114 group->poly[1] = 0; 102 group->poly[1] = 0;
115 group->poly[2] = 0; 103 group->poly[2] = 0;
@@ -272,18 +260,9 @@ ec_GF2m_simple_point_init(EC_POINT *point)
272 return 1; 260 return 1;
273} 261}
274 262
275/* Frees an EC_POINT. */
276static void
277ec_GF2m_simple_point_finish(EC_POINT *point)
278{
279 BN_free(&point->X);
280 BN_free(&point->Y);
281 BN_free(&point->Z);
282}
283
284/* Clears and frees an EC_POINT. */ 263/* Clears and frees an EC_POINT. */
285static void 264static void
286ec_GF2m_simple_point_clear_finish(EC_POINT *point) 265ec_GF2m_simple_point_finish(EC_POINT *point)
287{ 266{
288 BN_free(&point->X); 267 BN_free(&point->X);
289 BN_free(&point->Y); 268 BN_free(&point->Y);
@@ -727,7 +706,6 @@ static const EC_METHOD ec_GF2m_simple_method = {
727 .field_type = NID_X9_62_characteristic_two_field, 706 .field_type = NID_X9_62_characteristic_two_field,
728 .group_init = ec_GF2m_simple_group_init, 707 .group_init = ec_GF2m_simple_group_init,
729 .group_finish = ec_GF2m_simple_group_finish, 708 .group_finish = ec_GF2m_simple_group_finish,
730 .group_clear_finish = ec_GF2m_simple_group_clear_finish,
731 .group_copy = ec_GF2m_simple_group_copy, 709 .group_copy = ec_GF2m_simple_group_copy,
732 .group_set_curve = ec_GF2m_simple_group_set_curve, 710 .group_set_curve = ec_GF2m_simple_group_set_curve,
733 .group_get_curve = ec_GF2m_simple_group_get_curve, 711 .group_get_curve = ec_GF2m_simple_group_get_curve,
@@ -736,7 +714,6 @@ static const EC_METHOD ec_GF2m_simple_method = {
736 .group_check_discriminant = ec_GF2m_simple_group_check_discriminant, 714 .group_check_discriminant = ec_GF2m_simple_group_check_discriminant,
737 .point_init = ec_GF2m_simple_point_init, 715 .point_init = ec_GF2m_simple_point_init,
738 .point_finish = ec_GF2m_simple_point_finish, 716 .point_finish = ec_GF2m_simple_point_finish,
739 .point_clear_finish = ec_GF2m_simple_point_clear_finish,
740 .point_copy = ec_GF2m_simple_point_copy, 717 .point_copy = ec_GF2m_simple_point_copy,
741 .point_set_to_infinity = ec_GF2m_simple_point_set_to_infinity, 718 .point_set_to_infinity = ec_GF2m_simple_point_set_to_infinity,
742 .point_set_affine_coordinates = 719 .point_set_affine_coordinates =