summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_lib.c
diff options
context:
space:
mode:
authorjsing <>2025-05-24 08:25:58 +0000
committerjsing <>2025-05-24 08:25:58 +0000
commit1ede5cd4176ce288d6f0a00c790e1d04aa0d108b (patch)
tree05720c53df661e16f6cc31648d8dc9cffe10aa8e /src/lib/libcrypto/ec/ec_lib.c
parent3619e99136e45a9b10d78b643bae51a9a1b8e1c9 (diff)
downloadopenbsd-1ede5cd4176ce288d6f0a00c790e1d04aa0d108b.tar.gz
openbsd-1ede5cd4176ce288d6f0a00c790e1d04aa0d108b.tar.bz2
openbsd-1ede5cd4176ce288d6f0a00c790e1d04aa0d108b.zip
Provide method specific functions for EC POINT infinity.
Provide method specific functions for EC_POINT_set_to_infinity() and EC_POINT_is_at_infinity(). These are not always the same thing and will depend on the coordinate system in use. ok beck@ tb@
Diffstat (limited to 'src/lib/libcrypto/ec/ec_lib.c')
-rw-r--r--src/lib/libcrypto/ec/ec_lib.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c
index d760ecfb95..7cc7efe73f 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.124 2025/05/10 05:54:38 tb Exp $ */ 1/* $OpenBSD: ec_lib.c,v 1.125 2025/05/24 08:25:58 jsing 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 */
@@ -894,11 +894,7 @@ EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point)
894 ECerror(EC_R_INCOMPATIBLE_OBJECTS); 894 ECerror(EC_R_INCOMPATIBLE_OBJECTS);
895 return 0; 895 return 0;
896 } 896 }
897 897 return point->meth->point_set_to_infinity(group, point);
898 BN_zero(point->Z);
899 point->Z_is_one = 0;
900
901 return 1;
902} 898}
903LCRYPTO_ALIAS(EC_POINT_set_to_infinity); 899LCRYPTO_ALIAS(EC_POINT_set_to_infinity);
904 900
@@ -1200,8 +1196,7 @@ EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point)
1200 ECerror(EC_R_INCOMPATIBLE_OBJECTS); 1196 ECerror(EC_R_INCOMPATIBLE_OBJECTS);
1201 return 0; 1197 return 0;
1202 } 1198 }
1203 1199 return point->meth->point_is_at_infinity(group, point);
1204 return BN_is_zero(point->Z);
1205} 1200}
1206LCRYPTO_ALIAS(EC_POINT_is_at_infinity); 1201LCRYPTO_ALIAS(EC_POINT_is_at_infinity);
1207 1202