Skip to content

Commit 72ae030

Browse files
Tabaiearmfazh
authored andcommitted
refactor remove v12 sswu
1 parent 4d2724e commit 72ae030

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

mapping/sswu.go

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -109,37 +109,6 @@ func (m *sswu) Map(u GF.Elt) C.Point {
109109
return m.E.NewPoint(x, y)
110110
}
111111

112-
func (m *sswu) Map2(u GF.Elt) C.Point {
113-
F := m.E.F
114-
var t1, t2 GF.Elt
115-
var x1, x2, gx1, gx2, y2, x, y GF.Elt
116-
var e1, e2, e3 bool
117-
118-
t1 = F.Sqr(u) // 0. t1 = u^2
119-
t1 = F.Mul(t1, m.Z) // 1. t1 = Z * u^2
120-
t2 = F.Sqr(t1) // 2. t2 = t1^2
121-
x1 = F.Add(t1, t2) // 3. x1 = t1 + t2
122-
x1 = F.Inv0(x1) // 4. x1 = inv0(x1)
123-
e1 = F.IsZero(x1) // 5. e1 = x1 == 0
124-
x1 = F.Add(x1, F.One()) // 6. x1 = x1 + 1
125-
x1 = F.CMov(x1, m.c2, e1) // 7. x1 = CMOV(x1, c2, e1)
126-
x1 = F.Mul(x1, m.c1) // 8. x1 = x1 * c1
127-
gx1 = F.Sqr(x1) // 9. gx1 = x1^2
128-
gx1 = F.Add(gx1, m.E.A) // 10. gx1 = gx1 + A
129-
gx1 = F.Mul(gx1, x1) // 11. gx1 = gx1 * x1
130-
gx1 = F.Add(gx1, m.E.B) // 12. gx1 = gx1 + B
131-
x2 = F.Mul(t1, x1) // 13. x2 = t1 * x1
132-
t2 = F.Mul(t1, t2) // 14. t2 = t1 * t2
133-
gx2 = F.Mul(gx1, t2) // 15. gx2 = gx1 * t2
134-
e2 = F.IsSquare(gx1) // 16. e2 = is_square(gx1)
135-
x = F.CMov(x2, x1, e2) // 17. x = CMOV(x2, x1, e2)
136-
y2 = F.CMov(gx2, gx1, e2) // 18. y2 = CMOV(gx2, gx1, e2)
137-
y = F.Sqrt(y2) // 19. y = sqrt(y2)
138-
e3 = F.Sgn0(u) == F.Sgn0(y) // 20. e3 = sgn0(u) == sgn0(y)
139-
y = F.CMov(F.Neg(y), y, e3) // 21. y = CMOV(-y, y, e3)
140-
return m.E.NewPoint(x, y)
141-
}
142-
143112
type sswuAB0 struct {
144113
E C.W
145114
iso C.Isogeny

0 commit comments

Comments
 (0)