From: Loup Vaillant Date: Thu, 20 Feb 2020 23:00:44 +0000 (+0100) Subject: Elligator script: removed erroneous .abs() X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=128b567c5a694521342e27ecd19c49a4fbf02ba0;p=Monocypher.git Elligator script: removed erroneous .abs() Changing the sign of the v coordinate had an effect on the final value of the final hash, but wasn't detected because my initial tests only compare to the u coordinate, which appears to be correct. This doesn't affect the success or failure of the Elligator mapping, which only look at the u coordinate. Yet another example of incorrect crypto that looks like it works... --- diff --git a/tests/gen/elligator.py b/tests/gen/elligator.py index dc3073a..f5ef516 100755 --- a/tests/gen/elligator.py +++ b/tests/gen/elligator.py @@ -175,7 +175,7 @@ def from_edwards(point): x = point[0] y = point[1] u = (fe(1) + y) / (fe(1) - y) - v = (sqrt(fe(-486664)) * u / x).abs() + v = (sqrt(fe(-486664)) * u / x) return (u, v) # entire key generation chain