]> Cypherpunks.ru repositories - gogost.git/blobdiff - gost3410/public.go
Raised copyright years
[gogost.git] / gost3410 / public.go
index 8642a274bbceb0b19046bcdc72c6062339b2ed81..a5a4b7059b60d98a68f60ed435f8212bf2443b5c 100644 (file)
@@ -1,5 +1,5 @@
 // GoGOST -- Pure Go GOST cryptographic functions library
-// Copyright (C) 2015-2021 Sergey Matveev <stargrave@stargrave.org>
+// Copyright (C) 2015-2022 Sergey Matveev <stargrave@stargrave.org>
 //
 // This program is free software: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -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)
 }