]> Cypherpunks.ru repositories - gogost.git/blobdiff - src/cypherpunks.ru/gogost/gost341194/hash.go
34.11-94 PBKDF2 test vectors and digest reversing
[gogost.git] / src / cypherpunks.ru / gogost / gost341194 / hash.go
index ebbbca5460708d1bd07ee372dfe43b7558f44260..3ad4f7ad86071ebaeaf15a7fc17eba141d163853 100644 (file)
@@ -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[:]...)
 }