crypto

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSchemeNotExist = errors.New("scheme doesn't exist")

Functions

func Verify

func Verify(schemeName SchemeName, publicKey []byte, content []byte, signature []byte) (bool, error)

Types

type Scheme

type Scheme interface {
	Verify(data []byte, signature []byte) bool
	Sign(data []byte) ([]byte, error)
	Name() string
	PublicKey() []byte
	Address() (string, error)
	PublicKeyHex() string
}

func CreateScheme

func CreateScheme(schemeName SchemeName, seed string) (Scheme, error)

type SchemeName

type SchemeName string
const Ed25519 SchemeName = "ed25519"
const Secp256k1 SchemeName = "secp256k1"
const Sr25519 SchemeName = "sr25519"

Jump to

Keyboard shortcuts

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