@table @strong
+@anchor{Release 5.2}
+@item 5.2
+ @itemize
+ @item @code{GOST3410Curve} has @code{.contains(point)} method for
+ checking if point is on the curve.
+ @end itemize
+
@anchor{Release 5.1}
@item 5.1
Small typing stubs fixes.
self.cofactor = cofactor
self.e = e
self.d = d
- r1 = self.y * self.y % self.p
- r2 = ((self.x * self.x + self.a) * self.x + self.b) % self.p
- if r1 != self.pos(r2):
+ if not self.contains((x, y)):
raise ValueError("Invalid parameters")
self._st = None
return v + self.p
return v
+ def contains(self, point):
+ """Is point on the curve?
+
+ :type point: (long, long)
+ """
+ x, y = point
+ r1 = y * y % self.p
+ r2 = ((x * x + self.a) * x + self.b) % self.p
+ return r1 == self.pos(r2)
+
def _add(self, p1x, p1y, p2x, p2y):
if p1x == p2x and p1y == p2y:
# double
@property
def point_size(self) -> int: ...
+ def contains(self, point: Tuple[int, int]) -> bool: ...
+
def public_key(curve: GOST3410Curve, prv: int) -> PublicKey: ...