From: Loup Vaillant Date: Thu, 20 Feb 2020 23:21:21 +0000 (+0100) Subject: Elligator script: added fast_from_edwards X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=274f2b52ca8f5f45de6dffd0df7345fd1f23507d;p=Monocypher.git Elligator script: added fast_from_edwards --- diff --git a/tests/gen/elligator.py b/tests/gen/elligator.py index fa59588..df9c394 100755 --- a/tests/gen/elligator.py +++ b/tests/gen/elligator.py @@ -240,6 +240,17 @@ def fast_scalarmult(point, scalar): def fast_scalarbase(scalar): return fast_scalarmult(edwards_base, scalar) +def fast_from_edwards(point): + sqA = sqrt(fe(-486664)) # constant + x = point[0] + y = point[1] + z = point[2] + u = z + y + zu = z - y + v = u * z * sqA + zv = zu * x + return (u*zv, v*zu, zu*zv) + # 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):