crypto

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtendedEd25519Signer added in v0.1.22

type ExtendedEd25519Signer PrvKey

func (ExtendedEd25519Signer) Public added in v0.1.22

func (ExtendedEd25519Signer) Sign added in v0.1.22

func (e ExtendedEd25519Signer) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error)

type ExtendedPrivateKey added in v0.1.22

type ExtendedPrivateKey PrvKey

func (ExtendedPrivateKey) Sign added in v0.1.22

func (esk ExtendedPrivateKey) Sign(message []byte) []byte

type PrvKey

type PrvKey []byte

PrvKey is a ed25519 extended private key.

func NewPrvKey

func NewPrvKey(bech string) (PrvKey, error)

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

func (PrvKey) Bech32

func (sk PrvKey) Bech32(prefix string) string

Bech32 returns the private key encoded as bech32.

func (PrvKey) ExtendedEd25519Signer added in v0.1.22

func (sk PrvKey) ExtendedEd25519Signer() crypto.Signer

func (PrvKey) ExtendedPrivateKey added in v0.1.22

func (sk PrvKey) ExtendedPrivateKey() ExtendedPrivateKey

func (PrvKey) PrivateKey added in v0.1.22

func (sk PrvKey) PrivateKey() ed25519.PrivateKey

func (PrvKey) PubKey

func (sk PrvKey) PubKey() PubKey

PubKey returns the PubKey derived from the private key.

func (PrvKey) PublicKey added in v0.1.22

func (sk PrvKey) PublicKey() ed25519.PublicKey

func (PrvKey) Seed added in v0.1.22

func (sk PrvKey) Seed() []byte

func (PrvKey) Sign

func (sk PrvKey) Sign(message []byte) []byte

func (PrvKey) SignExtended added in v0.1.22

func (sk PrvKey) SignExtended(message []byte) []byte

func (PrvKey) String

func (sk PrvKey) String() string

type PubKey

type PubKey []byte

PubKey is a edd25519 public key.

func NewPubKey

func NewPubKey(bech string) (PubKey, error)

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

func (PubKey) Bech32

func (vk PubKey) Bech32(prefix string) string

Bech32 returns the public key encoded as bech32.

func (PubKey) Hash

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

Hash returns the public key hash using blake2b224.

func (PubKey) String

func (vk PubKey) String() string

func (PubKey) Verify

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

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

type XPrvKey

type XPrvKey []byte

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

func NewXPrvKey

func NewXPrvKey(bech string) (XPrvKey, error)

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

func NewXPrvKeyFromEntropy

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

func (XPrvKey) Bech32

func (xsk XPrvKey) Bech32(prefix string) string

Bech32 returns the private key encoded as bech32.

func (XPrvKey) Derive

func (xsk XPrvKey) Derive(index uint32) XPrvKey

Derive derives a children XPrv using BIP32-Ed25519

func (XPrvKey) PrvKey

func (xsk XPrvKey) PrvKey() PrvKey

PrvKey returns the ed25519 extended private key.

func (XPrvKey) PubKey

func (xsk XPrvKey) PubKey() PubKey

XPubKey returns the XPubKey derived from the extended private key.

func (XPrvKey) Seed added in v0.1.22

func (xsk XPrvKey) Seed() []byte

func (XPrvKey) Sign

func (xsk XPrvKey) Sign(message []byte) []byte

func (XPrvKey) String

func (xsk XPrvKey) String() string

func (XPrvKey) XPubKey

func (xsk XPrvKey) XPubKey() XPubKey

XPubKey returns the XPubKey derived from the extended private key.

type XPubKey

type XPubKey []byte

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

func NewXPubKey

func NewXPubKey(bech string) (XPubKey, error)

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

func (XPubKey) Derive

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

Derive derives a children XPub using BIP32-Ed25519

func (XPubKey) PubKey

func (xvk XPubKey) PubKey() PubKey

XPubKey returns the PubKey from the extended public key.

func (XPubKey) String

func (xvk XPubKey) String() string

func (XPubKey) Verify

func (xvk 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