sm3

package
v1.0.3029 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const BlockSize = 64

The blocksize of SM3 in bytes.

View Source
const BlockSizeDF = 64

The blocksize of SM3-DF in bytes.

View Source
const MAX_RESEED_COUNTER = (1 << 20)
View Source
const MAX_RESEED_SECONDS = 600
View Source
const Size = 32

The size of an SM3 checksum in bytes.

View Source
const SizeDF = 55

The size of an SM3-DF checksum in bytes.

Variables

This section is empty.

Functions

func FF00

func FF00(x, y, z uint32) uint32

func FF16

func FF16(x, y, z uint32) uint32

func GETU32

func GETU32(ptr []byte) uint32

func GG00

func GG00(x, y, z uint32) uint32

func GG16

func GG16(x, y, z uint32) uint32

func GenT added in v1.0.2075

func GenT() []uint32

func New

func New() hash.Hash

New returns a new hash.Hash computing the SM3 checksum.

func P0

func P0(x uint32) uint32

func P1

func P1(x uint32) uint32

func PUTU32

func PUTU32(ptr []byte, a uint32)

func ROTL

func ROTL(x uint32, n uint32) uint32

func Sum

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

Sum returns the SM3 checksum of the data.

Types

type DF

type DF struct {
	// contains filtered or unexported fields
}

func NewDF

func NewDF() *DF

func (*DF) BlockSize added in v1.0.2068

func (this *DF) BlockSize() int

func (*DF) Reset added in v1.0.2068

func (this *DF) Reset()

func (*DF) Size added in v1.0.2068

func (this *DF) Size() int

func (*DF) Sum

func (this *DF) Sum(in []byte) []byte

func (*DF) Write

func (this *DF) Write(data []byte)

type Rand

type Rand struct {
	V []byte
	C []byte
	// contains filtered or unexported fields
}

func NewRand

func NewRand(nonce []byte, label []byte) *Rand

func (*Rand) Generate

func (this *Rand) Generate(out []byte, addin []byte)

Jump to

Keyboard shortcuts

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