From a8cdfc7586b8f885d1107122409adffa049e36db Mon Sep 17 00:00:00 2001 From: Loup Vaillant Date: Sun, 23 Feb 2020 15:23:42 +0100 Subject: [PATCH] Elligator script: ordering nitpick --- tests/gen/elligator.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/gen/elligator.py b/tests/gen/elligator.py index 23014aa..994f9f1 100755 --- a/tests/gen/elligator.py +++ b/tests/gen/elligator.py @@ -229,9 +229,8 @@ def fast_curve_to_hash(point): return None if fe(2) * (u + A) * sq1**2 + u != fe(0): sq1 = (sq1 * sqrt1) if fe(2) * u * sq2**2 + u + A != fe(0): sq2 = (sq2 * sqrt1) - sq1 = sq1.abs() - sq2 = sq2.abs() - return sq1 if v.is_positive() else sq2 + sq = sq1 if v.is_positive() else sq2 + return sq.abs() # Explicit formula for hash_to_curve # We don't need the v coordinate for X25519, so it is omited -- 2.47.3