From: Loup Vaillant Date: Mon, 24 Feb 2020 00:06:12 +0000 (+0100) Subject: Elligator script: hoisted constant out X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=8297e3f784002d8b593626f7f7a9886e9772ad32;p=Monocypher.git Elligator script: hoisted constant out --- diff --git a/tests/gen/elligator.py b/tests/gen/elligator.py index 8c78047..d4deb77 100755 --- a/tests/gen/elligator.py +++ b/tests/gen/elligator.py @@ -278,6 +278,8 @@ def explicit_curve_to_hash(point): # wipe temporaries: ua, c, sq1, sq2, sqv, t1, t2, t3, t4, t5 return sq1 +half_A = A // 2 + # Explicit formula for hash_to_curve # We don't need the v coordinate for X25519, so it is omited def explicit_hash_to_curve(r): @@ -291,9 +293,8 @@ def explicit_hash_to_curve(r): e = e + fe(1) e = e * w e = chi(e) - t = A // 2 # constant u = fe(1) - e - u = u * t + u = u * half_A w = e * w u = w - u return u