// GoGOST -- Pure Go GOST cryptographic functions library
-// Copyright (C) 2015-2016 Sergey Matveev <stargrave@stargrave.org>
+// Copyright (C) 2015-2019 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
const (
BlockSize = 32
+ Size = 32
)
var (
- SboxDefault *gost28147.Sbox = &gost28147.GostR3411_94_TestParamSet
+ SboxDefault *gost28147.Sbox = &gost28147.SboxIdGostR341194TestParamSet
c2 [BlockSize]byte = [BlockSize]byte{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
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 {
chkBytes := chk.Bytes()
copy(block[BlockSize-len(chkBytes):], chkBytes)
hsh = h.step(hsh, *block)
+ blockReverse(hsh[:], hsh[:])
return append(in, hsh[:]...)
}