X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=gost3410%2Fpublic.go;h=85d3557bfe03c7506e4417ed258c6e62665aa46f;hb=220aa87670f1b7ed258374c7ec84a9d9463c7a94;hp=8642a274bbceb0b19046bcdc72c6062339b2ed81;hpb=6bb01904f8685018353233727eafceeb5a05ec64;p=gogost.git diff --git a/gost3410/public.go b/gost3410/public.go index 8642a27..85d3557 100644 --- a/gost3410/public.go +++ b/gost3410/public.go @@ -27,8 +27,8 @@ type PublicKey struct { Y *big.Int } -func NewPublicKey(curve *Curve, raw []byte) (*PublicKey, error) { - pointSize := curve.PointSize() +func NewPublicKey(c *Curve, raw []byte) (*PublicKey, error) { + pointSize := c.PointSize() key := make([]byte, 2*pointSize) if len(raw) != len(key) { return nil, fmt.Errorf("gogost/gost3410: len(key) != %d", len(key)) @@ -37,7 +37,7 @@ func NewPublicKey(curve *Curve, raw []byte) (*PublicKey, error) { key[i] = raw[len(raw)-i-1] } return &PublicKey{ - curve, + c, bytes2big(key[pointSize : 2*pointSize]), bytes2big(key[:pointSize]), }, nil @@ -114,5 +114,5 @@ func (our *PublicKey) Equal(theirKey crypto.PublicKey) bool { if !ok { return false } - return our.X.Cmp(their.X) == 0 && our.X.Cmp(their.Y) == 0 && our.C.Equal(their.C) + return our.X.Cmp(their.X) == 0 && our.Y.Cmp(their.Y) == 0 && our.C.Equal(their.C) }