sm3

package
v0.0.0-...-079ec6f Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package sm3 implements the SM3 hash algorithms as defined in http://www.oscca.gov.cn/sca/xxgk/2010-12/17/1002389/files/302a3ada057c4a73830536d03e683110.pdf.

Index

Constants

View Source
const BlockSize = 64

BlockSize indicates the blocksize of a SM3 checksum.

View Source
const Size = 32

Size indicates the Size of a SM3 checksum in bytes.

Variables

This section is empty.

Functions

func New

func New() hash.Hash

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

func Sum

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

Sum returns the SM3 checksum of the data.

Types

type Digest

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

Digest represents the partial evaluation of a checksum.

func (*Digest) BlockSize

func (d *Digest) BlockSize() int

BlockSize return the blocksize of SM3.

func (*Digest) Reset

func (d *Digest) Reset()

Reset resets the digest.

func (*Digest) Size

func (d *Digest) Size() int

Size return the size of SM3 in bytes.

func (*Digest) Sum

func (d *Digest) Sum(in []byte) []byte

Sum calculate the data of sm3 checmsum.

func (*Digest) Write

func (d *Digest) Write(p []byte) (nn int, err error)

Write write the p to digest.

Jump to

Keyboard shortcuts

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