From: Loup Vaillant Date: Fri, 27 Mar 2020 16:02:08 +0000 (+0100) Subject: Tiny simplification X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=14df1cb3db398d403bceaa3316e02dc5e4987fe4;p=Monocypher.git Tiny simplification --- 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); } }