sm234

package module
v0.0.0-...-4239c5d Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSM3Hash

func NewSM3Hash() hash.Hash

func NewSM4Block

func NewSM4Block(key []byte) (cipher.Block, error)

key 长度必须是 16 bytes = 128 bits

Types

type PrivateKey

type PrivateKey struct {
	PublicKey
	D *big.Int
}

PrivateKey represents a SM2 private key.

func SM2BytesToKey

func SM2BytesToKey(vbs []byte) (*PrivateKey, error)

func SM2GenerateKey

func SM2GenerateKey(rand io.Reader) (*PrivateKey, error)

func (*PrivateKey) Sign

func (priv *PrivateKey) Sign(rand io.Reader, digest []byte) (r, s *big.Int, err error)

digest : 32 bytes

type PublicKey

type PublicKey struct {
	X, Y *big.Int
	// contains filtered or unexported fields
}

PublicKey represents an SM2 public key.

func (*PublicKey) Verify

func (publ *PublicKey) Verify(digest []byte, r, s *big.Int) bool

digest : 32 bytes

Jump to

Keyboard shortcuts

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