From 90340319d5c3aaa4aafab37d65055a6f43025434 Mon Sep 17 00:00:00 2001
From: tb <>
Date: Wed, 26 Jul 2023 11:58:34 +0000
Subject: Use EC_POINT_set_to_infinity() rather than inlining it

---
 src/lib/libcrypto/ec/ecp_smpl.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

(limited to 'src/lib')

diff --git a/src/lib/libcrypto/ec/ecp_smpl.c b/src/lib/libcrypto/ec/ecp_smpl.c
index dab381721c..d270d495b8 100644
--- a/src/lib/libcrypto/ec/ecp_smpl.c
+++ b/src/lib/libcrypto/ec/ecp_smpl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ecp_smpl.c,v 1.48 2023/07/25 10:00:04 tb Exp $ */
+/* $OpenBSD: ecp_smpl.c,v 1.49 2023/07/26 11:58:34 tb Exp $ */
 /* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
  * for the OpenSSL project.
  * Includes code written by Bodo Moeller for the OpenSSL project.
@@ -704,11 +704,9 @@ ec_GFp_simple_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX
 	BIGNUM *n0, *n1, *n2, *n3;
 	int ret = 0;
 
-	if (EC_POINT_is_at_infinity(group, a) > 0) {
-		BN_zero(&r->Z);
-		r->Z_is_one = 0;
-		return 1;
-	}
+	if (EC_POINT_is_at_infinity(group, a) > 0)
+		return EC_POINT_set_to_infinity(group, r);
+
 	field_mul = group->meth->field_mul;
 	field_sqr = group->meth->field_sqr;
 	p = &group->field;
-- 
cgit v1.2.3-55-g6feb