sm3

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2023 License: Apache-2.0 Imports: 6 Imported by: 17

Documentation

Overview

Package sm3 handle shangmi sm3 hash algorithm

Index

Constants

View Source
const BlockSize int = 64

BlockSize SM3散列块字节数

View Source
const Size int = 32

Size SM3校验和字节数,即散列结果的字节长度

Variables

This section is empty.

Functions

func New

func New() hash.Hash

New 生成一个新的hash.Hash,用来计算SM3校验和。 New returns a new hash.Hash computing the SM3 checksum. The Hash also implements encoding.BinaryMarshaler and encoding.BinaryUnmarshaler to marshal and unmarshal the internal state of the hash.

func Sm3Sum

func Sm3Sum(data []byte) []byte

Sm3Sum returns the SM3 checksum of the data.

func Sm3SumArr

func Sm3SumArr(data []byte) (sumSm3 [Size]byte)

Sm3SumArr 计算Sm3散列值,返回长度32的字节数组

@param data 散列对象
@return sumSm3 长度32的字节数组

func Sum added in v0.0.4

func Sum(data []byte) [Size]byte

Sum 计算sm3散列值,返回长度32的字节数组

@param data 散列对象
@return [Size]byte 长度32的字节数组

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL