X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgogost%2Fgost3410%2Fcurve.go;h=0ad10c9ff747dcc4d3b3b5087f735d4bf2ee98a8;hb=cc6addfa724ba7b7d3119e9171c65298f0711ac4;hp=623ee6876dfebe4ece15ee1a4a858b650838758f;hpb=4d4b811d80fcd43eb79987e8ee9ddb6500dd8098;p=gogost.git diff --git a/src/cypherpunks.ru/gogost/gost3410/curve.go b/src/cypherpunks.ru/gogost/gost3410/curve.go index 623ee68..0ad10c9 100644 --- a/src/cypherpunks.ru/gogost/gost3410/curve.go +++ b/src/cypherpunks.ru/gogost/gost3410/curve.go @@ -67,12 +67,11 @@ func NewCurve(p, q, a, b, bx, by []byte) (*Curve, error) { r2.Mul(r2, c.X) r2.Add(r2, c.B) r2.Mod(r2, c.P) - if r2.Cmp(big.NewInt(0)) == -1 { - r2.Add(r2, c.P) - } + c.pos(r2) if r1.Cmp(r2) != 0 { return nil, errors.New("Invalid curve parameters") } + } return &c, nil }