diff --git a/orchard_group_hash.py b/orchard_group_hash.py index e0779c7..5ef0c9e 100644 --- a/orchard_group_hash.py +++ b/orchard_group_hash.py @@ -99,10 +99,7 @@ def map_to_curve_simple_swu(u): e1 = x1 == Fp(0) x1 = x1 + Fp(1) - if e1: - x1 = c2 - else: - x1 = x1 + x1 = c2 if e1 else x1 # If (tv1 + tv2) == 0, set x1 = -1 / Z x1 = x1 * c1 # x1 = (-B / A) * (1 + (1 / (Z^2 * u^4 + Z * u^2))) gx1 = x1.exp(2) diff --git a/orchard_iso_pallas.py b/orchard_iso_pallas.py index 0f55f61..fbdfe93 100755 --- a/orchard_iso_pallas.py +++ b/orchard_iso_pallas.py @@ -97,6 +97,7 @@ class Point(object): elif a.is_identity: return self else: + # Hüseyin Hışıl. “Elliptic Curves, Group Law, and Efficient Computation”. PhD thesis. # section 4.1 (x1, y1) = (self.x, self.y) (x2, y2) = (a.x, a.y) @@ -119,6 +120,7 @@ class Point(object): if self.is_identity: return self + # Hüseyin Hışıl. “Elliptic Curves, Group Law, and Efficient Computation”. PhD thesis. # section 4.1 λ = (Fp(3) * self.x * self.x + PALLAS_ISO_A) / (self.y + self.y) x3 = λ*λ - self.x - self.x