sm3

package
v1.0.2018 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const BlockSize = 64

The blocksize of SM3 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.

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 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) Sum

func (this *DF) Sum() (out [55]byte)

func (*DF) Write

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

type Rand

type Rand struct {
	V [55]uint8
	C [55]uint8
	// 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