From: Sergey Matveev Date: Wed, 10 Jul 2019 12:55:28 +0000 (+0300) Subject: Reuse _pos method X-Git-Tag: 4.0~1 X-Git-Url: http://www.git.cypherpunks.ru/?p=pygost.git;a=commitdiff_plain;h=0f9eff2c693f021fd502d5a4f2b98ccc0d3e13c5 Reuse _pos method --- diff --git a/pygost/gost3410.py b/pygost/gost3410.py index 1167676..f1baa58 100644 --- a/pygost/gost3410.py +++ b/pygost/gost3410.py @@ -54,9 +54,7 @@ class GOST3410Curve(object): self.y = y r1 = self.y * self.y % self.p r2 = ((self.x * self.x + self.a) * self.x + self.b) % self.p - if r2 < 0: - r2 += self.p - if r1 != r2: + if r1 != self._pos(r2): raise ValueError("Invalid parameters") def _pos(self, v):