From 0824b0ca5a9e753311325f57eb405ab37d9a7201 Mon Sep 17 00:00:00 2001 From: jsing Date: Tue, 8 Nov 2022 16:50:29 +0000 Subject: [PATCH] Remove pointless loops. From BoringSSL 997c706d43504. --- lib/libcrypto/curve25519/curve25519.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lib/libcrypto/curve25519/curve25519.c b/lib/libcrypto/curve25519/curve25519.c index ba177365878..7d223d9535b 100644 --- a/lib/libcrypto/curve25519/curve25519.c +++ b/lib/libcrypto/curve25519/curve25519.c @@ -1,4 +1,4 @@ -/* $OpenBSD: curve25519.c,v 1.7 2022/11/06 16:31:19 jsing Exp $ */ +/* $OpenBSD: curve25519.c,v 1.8 2022/11/08 16:50:29 jsing Exp $ */ /* * Copyright (c) 2015, Google Inc. * @@ -641,9 +641,6 @@ static void fe_invert(fe out, const fe z) { int i; fe_sq(t0, z); - for (i = 1; i < 1; ++i) { - fe_sq(t0, t0); - } fe_sq(t1, t0); for (i = 1; i < 2; ++i) { fe_sq(t1, t1); @@ -651,9 +648,6 @@ static void fe_invert(fe out, const fe z) { fe_mul(t1, z, t1); fe_mul(t0, t0, t1); fe_sq(t2, t0); - for (i = 1; i < 1; ++i) { - fe_sq(t2, t2); - } fe_mul(t1, t1, t2); fe_sq(t2, t1); for (i = 1; i < 5; ++i) { @@ -908,9 +902,6 @@ static void fe_pow22523(fe out, const fe z) { int i; fe_sq(t0, z); - for (i = 1; i < 1; ++i) { - fe_sq(t0, t0); - } fe_sq(t1, t0); for (i = 1; i < 2; ++i) { fe_sq(t1, t1); @@ -918,9 +909,6 @@ static void fe_pow22523(fe out, const fe z) { fe_mul(t1, z, t1); fe_mul(t0, t0, t1); fe_sq(t0, t0); - for (i = 1; i < 1; ++i) { - fe_sq(t0, t0); - } fe_mul(t0, t1, t0); fe_sq(t1, t0); for (i = 1; i < 5; ++i) { -- 2.20.1