lib/h2c/m2c/sswu.rb in h2c-0.1.0 vs lib/h2c/m2c/sswu.rb in h2c-0.2.0
- old
+ new
@@ -41,10 +41,10 @@
x = e2 ? x1 : x2
y2 = e2 ? gx1 : gx2
y = f.square_roots(y2)[0]
e3 = sgn0(u) == sgn0(y)
y = f.mod(e3 ? y : -y)
- [x, y]
+ curve.new_point([x, y])
end
def square?(x)
test = curve.field.power(x, ((curve.field.prime - 1) / 2))
[0, 1].include?(test)