ed25519

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FirstHardenedIndex = uint32(0x80000000)
)

Variables

View Source
var (
	ErrInvalidPath        = errors.New("invalid derivation path")
	ErrNoPublicDerivation = errors.New("no public derivation for ed25519")
)

Functions

func Verify

func Verify(publicKey []byte, message []byte, signature []byte) bool

Types

type Key

type Key struct {
	Key       []byte
	ChainCode []byte
}

func DeriveForPath

func DeriveForPath(path string, seed []byte) (*Key, error)

func NewMasterKey

func NewMasterKey(seed []byte) (*Key, error)

func (*Key) Derive

func (k *Key) Derive(i uint32) (*Key, error)

func (*Key) PublicKey

func (k *Key) PublicKey() ([]byte, error)

func (*Key) RawSeed

func (k *Key) RawSeed() [32]byte

type SignerEd25519

type SignerEd25519 struct {
	PrivateKey ed25519.PrivateKey
	PublicKey  ed25519.PublicKey
}

func NewSigner

func NewSigner() (*SignerEd25519, error)

func NewSignerByHex

func NewSignerByHex(privatekey string) (signerEd25519 *SignerEd25519, err error)

func NewSignerBySeed

func NewSignerBySeed(seed []byte) (signerEd25519 *SignerEd25519, err error)

func (*SignerEd25519) PrivateKeyBytes

func (s *SignerEd25519) PrivateKeyBytes() []byte

func (*SignerEd25519) PrivateKeyHex

func (s *SignerEd25519) PrivateKeyHex() string

func (*SignerEd25519) PublicBase64Key

func (s *SignerEd25519) PublicBase64Key() string

func (*SignerEd25519) PublicKeyBytes

func (s *SignerEd25519) PublicKeyBytes() []byte

func (*SignerEd25519) PublicKeyHex

func (s *SignerEd25519) PublicKeyHex() string

func (*SignerEd25519) SecretKeyBytes

func (s *SignerEd25519) SecretKeyBytes() []byte

func (*SignerEd25519) SecretKeyHex

func (s *SignerEd25519) SecretKeyHex() string

func (*SignerEd25519) Sign

func (s *SignerEd25519) Sign(message []byte) []byte

func (SignerEd25519) String

func (s SignerEd25519) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳