summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2025-01-25 13:13:57 +0000
committertb <>2025-01-25 13:13:57 +0000
commitc27317d514c4ad4eee1ef608f6cff14347a2f424 (patch)
tree8a3fd79a10b54cc4df43c30b1223aecdeecb58d0 /src
parent2acafbd3a0ab30747379afb675c42911a04666eb (diff)
downloadopenbsd-c27317d514c4ad4eee1ef608f6cff14347a2f424.tar.gz
openbsd-c27317d514c4ad4eee1ef608f6cff14347a2f424.tar.bz2
openbsd-c27317d514c4ad4eee1ef608f6cff14347a2f424.zip
Promote a few functions from EC API to garbage bin
EC_GROUP_method_of() and EC_METHOD_get_field_type() only ever used chained together as a convoluted means to retrieve the field type of a group. This is no longer useful since the answer will always be NID_X9_62_prime_field. EC_POINT_method_of(), EC_GROUP{,_have}_precompute_mult(): exposed by one of those expose-everything perl XS modules. ok jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/ec/ec_lib.c77
1 files changed, 41 insertions, 36 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c
index 6b18b82a72..a6259ed581 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.115 2025/01/25 10:37:50 tb Exp $ */ 1/* $OpenBSD: ec_lib.c,v 1.116 2025/01/25 13:13:57 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 */
@@ -222,20 +222,6 @@ EC_GROUP_dup(const EC_GROUP *in_group)
222} 222}
223LCRYPTO_ALIAS(EC_GROUP_dup); 223LCRYPTO_ALIAS(EC_GROUP_dup);
224 224
225const EC_METHOD *
226EC_GROUP_method_of(const EC_GROUP *group)
227{
228 return group->meth;
229}
230LCRYPTO_ALIAS(EC_GROUP_method_of);
231
232int
233EC_METHOD_get_field_type(const EC_METHOD *meth)
234{
235 return meth->field_type;
236}
237LCRYPTO_ALIAS(EC_METHOD_get_field_type);
238
239/* 225/*
240 * If there is a user-provided cofactor, sanity check and use it. Otherwise 226 * If there is a user-provided cofactor, sanity check and use it. Otherwise
241 * try computing the cofactor from generator order n and field cardinality p. 227 * try computing the cofactor from generator order n and field cardinality p.
@@ -903,13 +889,6 @@ EC_POINT_dup(const EC_POINT *in_point, const EC_GROUP *group)
903} 889}
904LCRYPTO_ALIAS(EC_POINT_dup); 890LCRYPTO_ALIAS(EC_POINT_dup);
905 891
906const EC_METHOD *
907EC_POINT_method_of(const EC_POINT *point)
908{
909 return point->meth;
910}
911LCRYPTO_ALIAS(EC_POINT_method_of);
912
913int 892int
914EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point) 893EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point)
915{ 894{
@@ -1386,20 +1365,6 @@ EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar,
1386} 1365}
1387LCRYPTO_ALIAS(EC_POINT_mul); 1366LCRYPTO_ALIAS(EC_POINT_mul);
1388 1367
1389int
1390EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx_in)
1391{
1392 return 1;
1393}
1394LCRYPTO_ALIAS(EC_GROUP_precompute_mult);
1395
1396int
1397EC_GROUP_have_precompute_mult(const EC_GROUP *group)
1398{
1399 return 0;
1400}
1401LCRYPTO_ALIAS(EC_GROUP_have_precompute_mult);
1402
1403/* 1368/*
1404 * XXX - remove everything below in the next bump 1369 * XXX - remove everything below in the next bump
1405 */ 1370 */
@@ -1440,3 +1405,43 @@ EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
1440 return 0; 1405 return 0;
1441} 1406}
1442LCRYPTO_ALIAS(EC_POINTs_mul); 1407LCRYPTO_ALIAS(EC_POINTs_mul);
1408
1409const EC_METHOD *
1410EC_GROUP_method_of(const EC_GROUP *group)
1411{
1412 ECerror(ERR_R_DISABLED);
1413 return NULL;
1414}
1415LCRYPTO_ALIAS(EC_GROUP_method_of);
1416
1417int
1418EC_METHOD_get_field_type(const EC_METHOD *meth)
1419{
1420 ECerror(ERR_R_DISABLED);
1421 return NID_undef;
1422}
1423LCRYPTO_ALIAS(EC_METHOD_get_field_type);
1424
1425const EC_METHOD *
1426EC_POINT_method_of(const EC_POINT *point)
1427{
1428 ECerror(ERR_R_DISABLED);
1429 return NULL;
1430}
1431LCRYPTO_ALIAS(EC_POINT_method_of);
1432
1433int
1434EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx_in)
1435{
1436 ECerror(ERR_R_DISABLED);
1437 return 0;
1438}
1439LCRYPTO_ALIAS(EC_GROUP_precompute_mult);
1440
1441int
1442EC_GROUP_have_precompute_mult(const EC_GROUP *group)
1443{
1444 ECerror(ERR_R_DISABLED);
1445 return 0;
1446}
1447LCRYPTO_ALIAS(EC_GROUP_have_precompute_mult);