]> Cypherpunks.ru repositories - gogost.git/blobdiff - gost3410/vko.go
Raise copyright years
[gogost.git] / gost3410 / vko.go
index fdf3a2f5cb191312f678297696745d75964049f6..b3036f577d2c7bd26a03ff38bdaa4442450ca3cb 100644 (file)
@@ -1,5 +1,5 @@
 // GoGOST -- Pure Go GOST cryptographic functions library
-// Copyright (C) 2015-2020 Sergey Matveev <stargrave@stargrave.org>
+// Copyright (C) 2015-2021 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
@@ -24,9 +24,9 @@ func (prv *PrivateKey) KEK(pub *PublicKey, ukm *big.Int) ([]byte, error) {
        if err != nil {
                return nil, err
        }
-       ukm = ukm.Mul(ukm, prv.C.Co)
-       if ukm.Cmp(bigInt1) != 0 {
-               keyX, keyY, err = prv.C.Exp(ukm, keyX, keyY)
+       u := big.NewInt(0).Set(ukm).Mul(ukm, prv.C.Co)
+       if u.Cmp(bigInt1) != 0 {
+               keyX, keyY, err = prv.C.Exp(u, keyX, keyY)
                if err != nil {
                        return nil, err
                }