func New() hash.Hash
创建哈希计算实例
func Sm3Sum(data []byte) []byte
type SM3 struct {
// contains filtered or unexported fields
}
func (sm3 *SM3) BlockSize() int
BlockSize returns the hash's underlying block size. The Write method must be able to accept any amount of data, but it may operate more efficiently if all writes are a multiple of the block size.
func (sm3 *SM3) Reset()
Reset clears the internal state by zeroing bytes in the state buffer. This can be skipped for a newly-created hash state; the default zero-allocated state is correct.
func (sm3 *SM3) Size() int
Size returns the number of bytes Sum will return.
func (sm3 *SM3) Sum(in []byte) []byte
返回SM3哈希算法摘要值 Sum appends the current hash to b and returns the resulting slice. It does not change the underlying hash state.
func (sm3 *SM3) Write(p []byte) (int, error)
Write (via the embedded io.Writer interface) adds more data to the running hash. It never returns an error.