From 89f8a35c713fdcc5ed28c33a003639b93e083b7f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 3 Oct 2015 18:57:41 +0200 Subject: Remove some unnecessary squeeze() calls As only the subtrahend in a sub() call needs to be squeezed, the squeeze can be skipped in these cases. --- src/ec25519.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ec25519.c b/src/ec25519.c index e419a0a..31c00a7 100644 --- a/src/ec25519.c +++ b/src/ec25519.c @@ -546,9 +546,9 @@ void ecc_25519_double(ecc_25519_work_t *out, const ecc_25519_work_t *in) { mult_int(D, 486664, A); add(t1, in->X, in->Y); square(t2, t1); - sub(t3, t2, A); squeeze(t3); + sub(t3, t2, A); sub(E, t3, B); - add(G, D, B); squeeze(G); + add(G, D, B); sub(F, G, C); sub(H, D, B); mult(out->X, E, F); @@ -568,7 +568,7 @@ void ecc_25519_add(ecc_25519_work_t *out, const ecc_25519_work_t *in1, const ecc add(t1, in1->X, in1->Y); add(t2, in2->X, in2->Y); mult(t3, t1, t2); - sub(t4, t3, A); squeeze(t4); + sub(t4, t3, A); sub(E, t4, B); sub(F, D, C); add(G, D, C); -- cgit v1.2.3