Commit acff03b3 authored by Michael Hamburg's avatar Michael Hamburg

eddsa_to_decaf_opt working

parent 7691fb13
......@@ -98,7 +98,11 @@ def decaf_to_eddsa_opt(s):
if hibit(s): raise Exception("invalid: s has high bit")
if not is_square(s^4 + (2-4*dM)*s^2 + 1): raise Exception("invalid: not on curve")
t = sqrt(s^4 + (2-4*dM)*s^2 + 1)/s
curve_eqn = s^4 + (2-4*dM)*s^2 + 1
isr,inv = isqrt_trick(curve_eqn,s)
t = isr * curve_eqn * inv
if hibit(t): t = -t
y = (1-s^2)/(1+s^2)
x = 2*magic/t
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment