adapter

package
v0.0.0-...-a293c92 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: BSD-3-Clause Imports: 5 Imported by: 9

Documentation

Index

Constants

View Source
const (
	SDF_Success            = C.int(0)
	SM2IDSize              = C.uint(16)
	AddrVerifyTypeChain33  = int(0)
	AddrVerifyTypeEthereum = int(1)
)

Variables

This section is empty.

Functions

func CloseHSMSession

func CloseHSMSession() error

CloseHSMSession:关闭设备

func GetPrivateKeyAccessRight

func GetPrivateKeyAccessRight(passwordStr string, keyIndex int) error

获取私钥访问权限

func MakeDERsignature

func MakeDERsignature(rb, sb []byte) []byte

func MakeRSVsignature

func MakeRSVsignature(rb, sb []byte, vb byte) []byte

func OpenHSMSession

func OpenHSMSession() error

OpenHSMSession:打开TASS HSM PCIe设备并建立session

func ReleaeAccessRight

func ReleaeAccessRight(keyIndex int) error

释放私钥访问权限

func SignSM2Internal

func SignSM2Internal(msg []byte, keyIndex int) (signatureR, signatureS []byte, err error)

func SignSecp256k1Hash

func SignSecp256k1Hash(hash []byte, keyIndex int) (signatureR, signatureS []byte, signatureV byte, err error)

通过硬件进行secp256k1签名

func SignSecp256k1Msg

func SignSecp256k1Msg(msg []byte, keyIndex int) (signatureR, signatureS []byte, signatureV byte, err error)

通过硬件进行secp256k1签名,输入为msg,内部进行SHA256计算后再进行签名

Types

This section is empty.

Jump to

Keyboard shortcuts

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