]> Cypherpunks.ru repositories - gogost.git/blobdiff - src/cypherpunks.ru/gogost/gost341194/hash.go
Raise copyright years
[gogost.git] / src / cypherpunks.ru / gogost / gost341194 / hash.go
index ebbbca5460708d1bd07ee372dfe43b7558f44260..1d6c409b54698c5d165b5a8189dfbcc14de46ffc 100644 (file)
@@ -1,5 +1,5 @@
 // GoGOST -- Pure Go GOST cryptographic functions library
-// Copyright (C) 2015-2016 Sergey Matveev <stargrave@stargrave.org>
+// Copyright (C) 2015-2018 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
@@ -79,7 +79,7 @@ func (h *Hash) Reset() {
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        }
        h.chk = big.NewInt(0)
-       h.buf = nil
+       h.buf = h.buf[:0]
 }
 
 func (h *Hash) BlockSize() int {
@@ -266,5 +266,6 @@ func (h *Hash) Sum(in []byte) []byte {
        chkBytes := chk.Bytes()
        copy(block[BlockSize-len(chkBytes):], chkBytes)
        hsh = h.step(hsh, *block)
+       blockReverse(hsh[:], hsh[:])
        return append(in, hsh[:]...)
 }