sm2

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//RR =  R * R mod P
	RR = [4]uint64{0x0000000200000003, 0x00000002ffffffff, 0x0000000100000001, 0x400000002}
	//R =  R mod P
	R = [4]uint64{0x0000000000000001, 0x00000000ffffffff, 0x0000000000000000, 0x100000000}

	//RRN = R * R mod N
	RRN = [4]uint64{0x901192af7c114f20, 0x3464504ade6fa2fa, 0x620fc84c3affe0d4, 0x1eb5e412a22b3d3b}
)

Functions

func InitTable

func InitTable() *[43][32 * 8]uint64

InitTable is used to compute the p256Precomputed table

func MarshalSig

func MarshalSig(x, y []byte) []byte

MarshalSig marshal signature

func REDC64

func REDC64(in *[4]uint64)

REDC64 is a REDC function

func Sign

func Sign(dgst []byte, reader io.Reader, key []byte) ([]byte, uint8, error)

func Sm2

func Sm2() elliptic.Curve

func Unmarshal

func Unmarshal(in []byte) (x []byte, y []byte)

Unmarshal unmarshal signature

func VerifySignature

func VerifySignature(sig, dgst []byte, X []byte, Y []byte) (bool, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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