crypto

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: GPL-3.0 Imports: 9 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrvKey added in v0.1.7

type PrvKey []byte

PrvKey is a ed25519 extended private key.

func NewPrvKey added in v0.1.7

func NewPrvKey(bech string) (PrvKey, error)

NewPrvKey creates a new private key from a bech32 encoded private key.

func (PrvKey) Bech32 added in v0.1.7

func (prv PrvKey) Bech32(prefix string) string

Bech32 returns the private key encoded as bech32.

func (PrvKey) PubKey added in v0.1.7

func (prv PrvKey) PubKey() PubKey

XPubKey returns the XPubKey derived from the private key.

func (*PrvKey) Sign added in v0.1.7

func (prv *PrvKey) Sign(message []byte) []byte

func (PrvKey) String added in v0.1.14

func (prv PrvKey) String() string

type PubKey added in v0.1.7

type PubKey []byte

PubKey is a edd25519 public key.

func NewPubKey added in v0.1.7

func NewPubKey(bech string) (PubKey, error)

NewPubKey creates a new public key from a bech32 encoded public key.

func (PubKey) Bech32 added in v0.1.8

func (pub PubKey) Bech32(prefix string) string

Bech32 returns the public key encoded as bech32.

func (PubKey) Hash added in v0.1.9

func (pub PubKey) Hash() ([]byte, error)

Hash returns the public key hash using blake2b224.

func (PubKey) String added in v0.1.14

func (pub PubKey) String() string

func (PubKey) Verify added in v0.1.7

func (pub PubKey) Verify(message, signature []byte) bool

Verify reports whether sig is a valid signature of message by the public key.

type XPrvKey added in v0.1.7

type XPrvKey []byte

XPrvKey is the extended private key (64 bytes) appended with the chain code (32 bytes).

func NewXPrvKey added in v0.1.7

func NewXPrvKey(bech string) (XPrvKey, error)

NewXPrvKey creates a new extended private key from a bech32 encoded private key.

func NewXPrvKeyFromEntropy added in v0.1.7

func NewXPrvKeyFromEntropy(entropy []byte, password string) XPrvKey

func (XPrvKey) Bech32 added in v0.1.7

func (prv XPrvKey) Bech32(prefix string) string

Bech32 returns the private key encoded as bech32.

func (XPrvKey) Derive added in v0.1.7

func (xsk XPrvKey) Derive(index uint32) XPrvKey

Derive derives a children XPrv using BIP32-Ed25519

func (XPrvKey) PrvKey added in v0.1.7

func (prv XPrvKey) PrvKey() PrvKey

PrvKey returns the ed25519 extended private key.

func (XPrvKey) PubKey added in v0.1.7

func (prv XPrvKey) PubKey() PubKey

XPubKey returns the XPubKey derived from the extended private key.

func (*XPrvKey) Sign added in v0.1.7

func (prv *XPrvKey) Sign(message []byte) []byte

func (XPrvKey) String added in v0.1.14

func (prv XPrvKey) String() string

func (XPrvKey) XPubKey added in v0.1.7

func (prv XPrvKey) XPubKey() XPubKey

XPubKey returns the XPubKey derived from the extended private key.

type XPubKey added in v0.1.7

type XPubKey []byte

XPubKey is the public key (32 bytes) appended with the chain code (32 bytes).

func NewXPubKey added in v0.1.7

func NewXPubKey(bech string) (XPubKey, error)

NewXPubKey creates a new extended public key from a bech32 encoded extended public key.

func (XPubKey) Derive added in v0.1.7

func (xvk XPubKey) Derive(index uint32) (XPubKey, error)

Derive derives a children XPub using BIP32-Ed25519

func (XPubKey) PubKey added in v0.1.7

func (pub XPubKey) PubKey() PubKey

XPubKey returns the PubKey from the extended public key.

func (XPubKey) String added in v0.1.14

func (pub XPubKey) String() string

func (XPubKey) Verify added in v0.1.7

func (pub XPubKey) Verify(message, sig []byte) bool

Verify reports whether sig is a valid signature of message by the extended public key.

Jump to

Keyboard shortcuts

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