From 14df1cb3db398d403bceaa3316e02dc5e4987fe4 Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Fri, 27 Mar 2020 17:02:08 +0100 Subject: [PATCH] Tiny simplification --- src/monocypher.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/monocypher.c b/src/monocypher.c index 756be32..59496f6 100644 --- a/src/monocypher.c +++ b/src/monocypher.c @@ -1874,9 +1874,9 @@ static void ge_double_scalarmult_vartime(ge *P, const u8 p[32], const u8 b[32]) ge P2, tmp; ge_double(&P2, P, &tmp); ge_cache(&cP[0], P); - FOR (i, 0, (P_W_SIZE)-1) { - ge_add(&tmp, &P2, &cP[i]); - ge_cache(&cP[i+1], &tmp); + FOR (i, 1, P_W_SIZE) { + ge_add(&tmp, &P2, &cP[i-1]); + ge_cache(&cP[i], &tmp); } } -- 2.47.3