crypto

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT, Apache-2.0, MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const DST = string("BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_")

Variables

This section is empty.

Functions

func Verify added in v1.2.0

func Verify(sig *crypto.Signature, addr address.Address, msg []byte) error

Types

type PrivateKey

type PrivateKey interface {
	// Private to public
	Public() []byte
	// private key signature
	Sign([]byte) (*crypto.Signature, error)
	// private key data
	Bytes() []byte
	// key address, depends on network changes
	Address() (address.Address, error)
	// key sign type
	Type() types.SigType
	// key type
	KeyType() types.KeyType
	// map to keyInfo
	ToKeyInfo() *types.KeyInfo
}

private key constraints in wallet

func GeneratePrivateKey

func GeneratePrivateKey(st types.SigType) (PrivateKey, error)

func NewKeyFromData

func NewKeyFromData(st types.SigType, prv []byte) (PrivateKey, error)

func NewKeyFromData2

func NewKeyFromData2(kt types.KeyType, prv []byte) (PrivateKey, error)

func NewKeyFromKeyInfo

func NewKeyFromKeyInfo(ki *types.KeyInfo) (PrivateKey, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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