X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=gost3410%2Fvko2001.go;h=c9aeada21a90a36f782a49497aaa8c4af347a813;hb=9f3355e3239fed2b0110b0724e7ba1ed509b8a19;hp=c950280bf7f6de78a5e4ee71e4aab7898488ca22;hpb=0da4d634ac5368d024489baf4bdd5d422b84dd84;p=gogost.git diff --git a/gost3410/vko2001.go b/gost3410/vko2001.go index c950280..c9aeada 100644 --- a/gost3410/vko2001.go +++ b/gost3410/vko2001.go @@ -1,5 +1,5 @@ // GoGOST -- Pure Go GOST cryptographic functions library -// Copyright (C) 2015-2019 Sergey Matveev +// Copyright (C) 2015-2020 Sergey Matveev // // 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 @@ -34,6 +34,8 @@ func (prv *PrivateKey) KEK2001(pub *PublicKey, ukm *big.Int) ([]byte, error) { return nil, err } h := gost341194.New(&gost28147.SboxIdGostR341194CryptoProParamSet) - h.Write(key) + if _, err = h.Write(key); err != nil { + return nil, err + } return h.Sum(key[:0]), nil }